-
Notifications
You must be signed in to change notification settings - Fork 132
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
Dockerfiles redesigned #3434
Merged
Merged
Dockerfiles redesigned #3434
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Wiz Scan Summary
|
Signed-off-by: Alexander Pyatakov <[email protected]>
Signed-off-by: Alexander Pyatakov <[email protected]>
Signed-off-by: Alexander Pyatakov <[email protected]>
Signed-off-by: Alexander Pyatakov <[email protected]>
Signed-off-by: Alexander Pyatakov <[email protected]>
Signed-off-by: Alexander Pyatakov <[email protected]>
Signed-off-by: Alexander Pyatakov <[email protected]>
Signed-off-by: Alexander Pyatakov <[email protected]>
Signed-off-by: Alexander Pyatakov <[email protected]>
Signed-off-by: Alexander Pyatakov <[email protected]>
Signed-off-by: Alexander Pyatakov <[email protected]>
ef0dbfd
to
887d1b6
Compare
simvalery
approved these changes
Apr 9, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR contains completely redesigned Docker files for each service and an updated docker-compose file. They contain several changes and improvements over the original version. Overall, the updated Docker files follows best practices for multi-stage builds, caching, and creating smaller and more secure final images.
Changes
Here's a summary of the main changes:
NODE_VERSION
is defined as an argument at the beginning of the Dockerfile to specify the Node.js version.node:20.11.1-alpine
variant of the Node.js image, which is a slimmer version compared to the fullnode:20
image. Slim variants contain only the essential packages needed to run Node.js applications, resulting in smaller image sizes and increased security./root/.yarn
) using the--mount=type=cache
flag. This helps speed up subsequent builds by reusing the cached dependencies.COPY --link
flag to create hardlinks instead of copying files, which can help reduce image size and improve build performance.deps
stage, which allows for better layer caching and faster builds. This stage is used to create a smaller final image that doesn't include development dependencies.node
) for improved security.yarn install
command to thebuild
stage and added the--frozen-lockfile
flag (where possible) to ensure reproducibility.CMD
instruction, which is the recommended format.image
) copies only the necessary files from thedeps
andbuild
stages, reducing the image size..dockerignore
files added (or updated) for every service to make sure that only relevant files are copied.init: true
option in a Docker Compose file specifies that the container should run as an init process. This means that the container will be responsible for initializing the system and starting other processes within the container. https://docs.docker.com/compose/compose-file/compose-file-v2/#initChecklist