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

Update Dockerfile #1097

Merged
merged 3 commits into from
Mar 3, 2025
Merged

Update Dockerfile #1097

merged 3 commits into from
Mar 3, 2025

Conversation

ilya-levin-lokalise
Copy link
Contributor

@ilya-levin-lokalise ilya-levin-lokalise commented Mar 3, 2025

No description provided.

Here are the key improvements made to the Dockerfile:

1. **Smaller Base Image**: Changed from `node:20.15.1-bookworm-slim` to `node:22-alpine`, which is smaller and uses a newer Node.js version

2. **Simplified Build Process**: Reduced from 4 stages (base, dependencies, build, app, release) to just 3 stages (base, builder, runner)

3. **Alpine Package Manager**: Replaced Debian's `apt-get` with Alpine's `apk`, which is more lightweight

4. **More Efficient File Copying**: 
   - Copies specific files instead of using `.` to copy everything

5. **Streamlined User Permissions**:
   - Sets the `node` user once in the runner stage rather than multiple times
   - Eliminates redundant user switching between stages

6. **Improved Build Dependencies**:
   - Combines the installation of development and production dependencies in a single stage
   - Uses `--omit dev` flag for production dependencies

7. **Reduced Layer Count**: 
   - Combines related operations into single RUN commands

These changes result in a more efficient, smaller, and more maintainable Dockerfile with fewer layers and a more straightforward build process.
@ilya-levin-lokalise ilya-levin-lokalise requested a review from a team as a code owner March 3, 2025 07:24
Copy link
Collaborator

@kibertoad kibertoad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@ilya-levin-lokalise ilya-levin-lokalise merged commit 20558ce into main Mar 3, 2025
3 checks passed
@ilya-levin-lokalise ilya-levin-lokalise deleted the ilya-levin-lokalise-patch-1 branch March 3, 2025 08:43
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.

2 participants