From a512d343a3aecdbeddca550e3018ddc8aeae89aa Mon Sep 17 00:00:00 2001 From: stevenhuyn <18359644+stevenhuyn@users.noreply.github.com> Date: Wed, 18 Sep 2024 16:22:38 -0700 Subject: [PATCH] Update dockerfile to serve the static files --- Dockerfile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index d6761bb..613ea8b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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;"] \ No newline at end of file