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

refactor(build): Optimized Dockerfiles (@ilolm) #5955

Merged
merged 4 commits into from
Oct 9, 2024

Conversation

ilolm
Copy link
Contributor

@ilolm ilolm commented Oct 8, 2024

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.

ilolm added 2 commits October 8, 2024 17:19
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.
@ilolm ilolm changed the title Optimized Dockerfiles refactor(build): Optimized Dockerfiles Oct 8, 2024
@ilolm ilolm changed the title refactor(build): Optimized Dockerfiles refactor(build): Optimized Dockerfiles (@ilolm) Oct 8, 2024
Copy link
Member

@fehmer fehmer left a 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

@github-actions github-actions bot added waiting for update Pull requests or issues that require changes/comments before continuing and removed waiting for update Pull requests or issues that require changes/comments before continuing labels Oct 8, 2024
@ilolm
Copy link
Contributor Author

ilolm commented Oct 9, 2024

This should work now, everything compiles as expected on me.

@fehmer
Copy link
Member

fehmer commented Oct 9, 2024

Backend image reduction is 3MB and one less layer, frontend size/layers is not reduced.

@Miodec Miodec merged commit ebf98f1 into monkeytypegame:master Oct 9, 2024
12 checks passed
@Miodec
Copy link
Member

Miodec commented Oct 9, 2024

Thanks guys

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.

3 participants