Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerize multi stage #35

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

soumitradev
Copy link
Member

Make the docker build multi-stage

I'm new to this, so I need a review to see if this is the right way to do it.

@netlify
Copy link

netlify bot commented Jun 17, 2023

👷 Deploy request for chronofactorem pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 50eab34

@soumitradev soumitradev requested a review from pnicto June 17, 2023 00:29
Comment on lines +9 to +18
# Deploy stage
FROM node:17-bullseye-slim
WORKDIR /usr/src/app

COPY --chown=node:node . .
RUN rm -rf client
RUN mkdir -p client/build
COPY --from=chrono-build-stage --chown=node:node /usr/src/app/build /usr/src/app/client/build

RUN apt-get update && apt-get install -y --no-install-recommends dumb-init && apt-get clean && rm -rf /var/lib/apt/lists/*
Copy link
Member

Choose a reason for hiding this comment

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

I think explicitly setting NODE_ENV again in the deploy stage would be a good idea. Everything else looks good.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll do this, and I'll be optimizing it a little more (docker cache works really well with pnpm)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants