-
Notifications
You must be signed in to change notification settings - Fork 8
refactor: enhance Dockerfiles and entrypoint scripts, update dependen… #763
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,9 @@ | ||
| node_modules | ||
| npm-debug.log | ||
| npm-debug.log | ||
| build/ | ||
| *.log | ||
| .env | ||
| .git | ||
| .gitignore | ||
| Dockerfile | ||
| .dockerignore |
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,20 @@ | ||
| FROM --platform=linux/amd64 node:24.1.0-alpine3.22 | ||
| FROM node:24.4.1-alpine | ||
|
|
||
| WORKDIR /usr/src/app | ||
|
|
||
| COPY package*.json ./ | ||
|
|
||
| RUN npm install | ||
| RUN npm install \ | ||
| && addgroup -S nodeapp \ | ||
| && adduser -S nodeapp -G nodeapp | ||
|
|
||
| COPY . . | ||
|
|
||
| # If your app writes to a build or other directory, create and set permissions here | ||
| RUN mkdir -p /usr/src/app/build && chown -R nodeapp:nodeapp /usr/src/app | ||
|
|
||
| USER nodeapp | ||
|
|
||
| EXPOSE 5001 | ||
|
|
||
| CMD [ "npm","run", "dev"] | ||
| CMD [ "npm", "run", "dev" ] |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,9 @@ | ||
| node_modules | ||
| npm-debug.log | ||
| build | ||
| Dockerfile | ||
| build/ | ||
| *.log | ||
| .git | ||
| .gitignore | ||
| .dockerignore | ||
| .env |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,21 @@ | ||
| FROM --platform=linux/amd64 node:22-alpine | ||
| FROM node:22-alpine | ||
|
|
||
| WORKDIR /usr/src/app | ||
|
|
||
| COPY package*.json ./ | ||
|
|
||
| RUN apk update && apk upgrade && npm install | ||
| RUN apk update && apk upgrade \ | ||
| && npm install \ | ||
| && addgroup -S nodeapp \ | ||
| && adduser -S nodeapp -G nodeapp | ||
|
|
||
| COPY . . | ||
|
|
||
| # Ensure permissions for nodeapp user | ||
| RUN chown -R nodeapp:nodeapp /usr/src/app | ||
|
|
||
| USER nodeapp | ||
|
|
||
| EXPOSE 3000 | ||
|
|
||
| CMD [ "npm","run", "start"] | ||
| CMD [ "npm", "run", "start" ] |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,26 @@ | ||
| # Use an official Node.js runtime as a base image | ||
| FROM --platform=linux/amd64 node:24.1.0-alpine3.22 | ||
| FROM node:24.4.1-alpine | ||
|
|
||
| # Set the working directory in the container | ||
| WORKDIR /app | ||
|
|
||
| # Copy package.json and package-lock.json to the working directory | ||
| COPY package*.json ./ | ||
|
|
||
| # Install application dependencies | ||
| RUN npm install | ||
| RUN npm install \ | ||
| && addgroup -S nodeapp \ | ||
| && adduser -S nodeapp -G nodeapp | ||
|
|
||
| # Copy the application code to the container | ||
| COPY . . | ||
|
|
||
| # Expose the port your app will run on | ||
| RUN mkdir -p /app/build \ | ||
| && mkdir -p /app/extracted_files \ | ||
| && chown -R nodeapp:nodeapp /app | ||
|
|
||
| COPY docker-entrypoint.sh /usr/local/bin/ | ||
| RUN chmod +x /usr/local/bin/docker-entrypoint.sh | ||
|
|
||
| USER nodeapp | ||
|
|
||
| EXPOSE 4002 | ||
|
|
||
| # Define the command to run your application | ||
| CMD ["npm", "run", "start"] | ||
| ENTRYPOINT ["docker-entrypoint.sh"] | ||
|
|
||
| CMD ["npm", "run", "start"] |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #!/bin/sh | ||
| set -e | ||
|
|
||
| # Fix permissions for extracted_files volume at runtime | ||
| chown -R nodeapp:nodeapp /app/extracted_files | ||
|
|
||
| exec "$@" |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.