Skip to content

Commit

Permalink
Added new dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jordan-dalby committed Nov 17, 2024
1 parent 8191392 commit dff7446
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ RUN npm run build
FROM node:18-alpine
WORKDIR /app

# Install build dependencies
RUN apk add --no-cache python3 make g++ gcc

# Copy server source and dependencies
WORKDIR /app
COPY server/package.json ./
Expand All @@ -23,6 +26,9 @@ COPY --from=client-build /app/client/build /client/build
# Create output directory
RUN mkdir -p ./data/snippets

# Clean up build dependencies to reduce image size
RUN apk del python3 make g++ gcc

EXPOSE 5000

CMD ["node", "src/app.js"]

1 comment on commit dff7446

@stumpylog
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't currently have time to offer a PR, but as a heads up, removing items installed in one layer in a different layer doesn't actually remove the size, just the file. Docker build overlay the file system, so you would have to combine these into a single RUN to actually reduce the image size (or copy the build to another stage)

Please sign in to comment.