-
Notifications
You must be signed in to change notification settings - Fork 0
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
Setup docker for project #3
Conversation
4713d3e
to
6c1261a
Compare
64fbcba
to
5b74b33
Compare
3051d1b
to
5ac9764
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to do a mutli-stage build (https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#use-multi-stage-builds)? I prefer smaller final image sizes.
c0999aa
to
dd467bd
Compare
COPY --from=builder /root/.local /root/.local | ||
COPY --from=builder /app /app | ||
WORKDIR app | ||
RUN apt-get update && apt-get install libpq-dev -y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to repeat this libpq-dev
package because apparently psycopg2
needs it both to install and to run and I couldn't find a way to copy the packages from the build image
to the app image
. All in all, I was able to bring the final image down to 275MB from around 599MB. I'll keep doing more research concerning this libpq-dev
package and definitely raise an patch pr
to fix it when I get a fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kilemensi ☝️ cc @KhadijaMahanga
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird but cool @ascii-dev i.e. would have assumed dev packages are only needed to build binaries & hence we should have been able to just copy the built binaries into app image... but we're short on time right now so 300MB reduction is good enough. 🚀
COPY --from=builder /root/.local /root/.local | ||
COPY --from=builder /app /app | ||
WORKDIR app | ||
RUN apt-get update && apt-get install libpq-dev -y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird but cool @ascii-dev i.e. would have assumed dev packages are only needed to build binaries & hence we should have been able to just copy the built binaries into app image... but we're short on time right now so 300MB reduction is good enough. 🚀
Description
Sets up docker to aid in development and deployment.
Fixes #172525811
Type of change
Please delete options that are not relevant.
Checklist: