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 Dockerfile to use multi-stage builds and add caching mechanisms #514

Merged
merged 2 commits into from
Aug 11, 2024

Conversation

catatsuy
Copy link
Owner

This pull request includes significant updates to the Dockerfile for the Golang web application. The changes improve build performance, add multi-stage builds, and enhance security by running the application as a non-privileged user.

Dockerfile improvements:

  • Changed the Dockerfile syntax to use docker/dockerfile:1 for enhanced features and performance.
  • Implemented multi-stage builds to separate the build environment from the runtime environment, improving security and reducing the final image size.
  • Added --mount options for caching dependencies and binding source files, which speeds up the build process.
  • Created a non-privileged user to run the application, following best practices for container security.
  • Switched the base image for the runtime environment to alpine:3.20 for a smaller, more secure final image.

@catatsuy catatsuy changed the title Feature update golang dockerfile Refactor Dockerfile to use multi-stage builds and add caching mechanisms Aug 11, 2024
@catatsuy catatsuy merged commit 4148419 into master Aug 11, 2024
4 checks passed
@catatsuy catatsuy deleted the feature-update-golang-dockerfile branch August 11, 2024 01:02
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.

1 participant