Skip to content

Commit

Permalink
Dockerfile: separate in two stages (build and serve)
Browse files Browse the repository at this point in the history
  • Loading branch information
LoicGombeaud committed Dec 8, 2024
1 parent 4eb1399 commit 2f655d2
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
###############
# Build stage #
###############

FROM node:20.6.1-alpine3.18 AS build

# Set working directory
Expand All @@ -14,8 +18,10 @@ ADD . .
# Build the pages
RUN npm run generate

# Configure Nitro server
ENV NITRO_PORT 80
####################
# Web server stage #
####################

FROM nginx:1.27.3-alpine

# Start Nitro server
CMD ["node", ".output/server/index.mjs"]
COPY --from=build /voiesbordelaises/dist /usr/share/nginx/html

0 comments on commit 2f655d2

Please sign in to comment.