Skip to content

Commit

Permalink
Update dockerfile to serve the static files
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenhuyn committed Sep 18, 2024
1 parent 491b2a8 commit a512d34
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ COPY --from=builder /pkg ../cubeway/pkg
# Build the frontend assets
RUN npm run build

# Stage 3: Serve the built files with simple-http-server
FROM rust:latest AS server
# Stage 3: Serve the built files
FROM nginx:alpine

# Install simple-http-server
RUN cargo install simple-http-server
# Copy the built frontend assets into the nginx html directory
COPY --from=frontend /app/dist /usr/share/nginx/html

# Set the working directory to /app/dist inside the container
WORKDIR /app/dist
# Expose port 80
EXPOSE 80

# Copy the built frontend files from the frontend stage
COPY --from=frontend /app/dist ./
# Start nginx server
CMD ["nginx", "-g", "daemon off;"]

0 comments on commit a512d34

Please sign in to comment.