build(dockerfile): enhanced production dockerfile #1151
Merged
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.
Types of changes
Description
Use multi-stage feature on Docker to enable easy-read and better maintenance for Dockerfile
Two stages: node_stage and python_stage
node_stage:
FROM
, we can specify docker image taf and get the node run-time with no extra works (nvm and hardcoded download link)python_stage:
Notes:
Steps to Test This Pull Request
Expected behavior
Size reduced up to 50% and more
from the staging environment, test results are as follow:
pycontw-2023_web-enhanced-dockerfile latest e620e4f466ac 24 seconds ago 626MB
pycontw-2023_web latest 11ff9f780b7d 2 weeks ago 1.56GB
closes #1139