Skip to content

Commit

Permalink
Merge pull request #24 from score-spec/multi-stage-build
Browse files Browse the repository at this point in the history
Multi stage build container
  • Loading branch information
mathieu-benoit authored May 10, 2024
2 parents 58a76a1 + 80cf9c6 commit 9905140
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 9905140

Please sign in to comment.