Skip to content

Commit

Permalink
Multi stage build container
Browse files Browse the repository at this point in the history
Signed-off-by: Mathieu Benoit <mathieu.benoit@humanitec.com>
  • Loading branch information
mathieu-benoit committed May 9, 2024
1 parent ff069e5 commit 80cf9c6
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
FROM alpine:3.19.1

# Install nodejs
FROM alpine:3.19.1 as builder
RUN apk add --no-cache nodejs npm

COPY package*.json ./
RUN npm install --only=prod

FROM alpine:3.19.1
RUN apk add --no-cache nodejs
COPY --from=builder /node_modules ./node_modules
COPY index.js index.js

# Expose port 3000
EXPOSE 3000

# Run the app
CMD ["node", "index.js"]
CMD ["node", "index.js"]

0 comments on commit 80cf9c6

Please sign in to comment.