-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
refactor(build): Optimized Dockerfiles (@ilolm) #5955
Conversation
1. Reduced layers amount. 2. Optimized. 3. Reduced image size by adding `--no-cache` option to `apk`. 4. Added `apk update --no-cache`, to always have the latest version of wget.
Reduced layers amount.
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.
Hi,
i'm using docker version 27.3.1 and both files are failing to build. Which version of docker are you using?
Frontend:
Dockerfile:5
--------------------
3 |
4 | #ENV
5 | >>> ENV ["BACKEND_URL=###MONKEYTYPE_BACKENDURL###", "RECAPTCHA_SITE_KEY=###RECAPTCHA_SITE_KEY###"]
6 |
7 | #COPY
--------------------
ERROR: failed to solve: failed to process "[\"BACKEND_URL": unexpected end of statement while looking for matching double-quote
Backend:
Dockerfile:9
--------------------
8 | #gimme pnpm + build
9 | >>> RUN npm i -g pnpm && \
10 | >>> pnpm i --frozen-lockfile && \
11 | >>> npm run build
12 |
--------------------
ERROR: failed to solve: process "/bin/sh -c npm i -g pnpm && pnpm i --frozen-lockfile && npm run build" did not complete successfully: exit code: 1
This should work now, everything compiles as expected on me. |
Backend image reduction is 3MB and one less layer, frontend size/layers is not reduced. |
Thanks guys |
Description
Optimized frontend Dockerfile and backend Dockerfile. Reduced layers amount, reduce size of the image.Closes
Optimizes the output docker image and it's size.