-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cache pip install in python Dockerfiles (#461)
* Cache pip install in python Dockerfiles * Update Dockerfile * Update Dockerfile * fix Dockerfile --------- Co-authored-by: Mohamed Elasmar <[email protected]>
- Loading branch information
1 parent
3d44a06
commit 9badf4c
Showing
10 changed files
with
38 additions
and
18 deletions.
There are no files selected for viewing
6 changes: 4 additions & 2 deletions
6
python3.10/apigw-pytorch/{{cookiecutter.project_name}}/app/Dockerfile
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
FROM public.ecr.aws/lambda/python:3.10 | ||
|
||
COPY app.py requirements.txt ./ | ||
COPY model /opt/ml/model | ||
COPY requirements.txt ./ | ||
|
||
RUN python3.10 -m pip install -r requirements.txt -t . | ||
|
||
COPY model /opt/ml/model | ||
COPY app.py ./ | ||
|
||
CMD ["app.lambda_handler"] |
6 changes: 4 additions & 2 deletions
6
python3.10/apigw-scikit/{{cookiecutter.project_name}}/app/Dockerfile
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
FROM public.ecr.aws/lambda/python:3.10 | ||
|
||
COPY app.py requirements.txt ./ | ||
COPY model /opt/ml/model | ||
COPY requirements.txt ./ | ||
|
||
# temporarily install gcc so that scikit-learn can be built | ||
RUN yum install gcc-c++ -y | ||
|
||
RUN python3.10 -m pip install -r requirements.txt -t . | ||
|
||
COPY model /opt/ml/model | ||
COPY app.py ./ | ||
|
||
CMD ["app.lambda_handler"] |
6 changes: 4 additions & 2 deletions
6
python3.10/apigw-tensorflow/{{cookiecutter.project_name}}/app/Dockerfile
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
FROM public.ecr.aws/lambda/python:3.10 | ||
|
||
COPY app.py requirements.txt ./ | ||
COPY model /opt/ml/model | ||
COPY requirements.txt ./ | ||
|
||
RUN python3.10 -m pip install -r requirements.txt -t . | ||
|
||
COPY model /opt/ml/model | ||
COPY app.py ./ | ||
|
||
CMD ["app.lambda_handler"] |
6 changes: 4 additions & 2 deletions
6
python3.10/apigw-xgboost/{{cookiecutter.project_name}}/app/Dockerfile
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
FROM public.ecr.aws/lambda/python:3.10 | ||
|
||
COPY app.py requirements.txt ./ | ||
COPY model /opt/ml/model | ||
COPY requirements.txt ./ | ||
|
||
RUN python3.10 -m pip install -r requirements.txt -t . | ||
|
||
COPY model /opt/ml/model | ||
COPY app.py ./ | ||
|
||
CMD ["app.lambda_handler"] |
4 changes: 3 additions & 1 deletion
4
python3.10/hello-img/{{cookiecutter.project_name}}/hello_world/Dockerfile
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
FROM public.ecr.aws/lambda/python:3.10 | ||
|
||
COPY app.py requirements.txt ./ | ||
COPY requirements.txt ./ | ||
|
||
RUN {{cookiecutter.runtime}} -m pip install -r requirements.txt -t . | ||
|
||
COPY app.py ./ | ||
|
||
# Command can be overwritten by providing a different command in the template directly. | ||
CMD ["app.lambda_handler"] |
6 changes: 4 additions & 2 deletions
6
python3.11/apigw-pytorch/{{cookiecutter.project_name}}/app/Dockerfile
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
FROM public.ecr.aws/lambda/python:3.11 | ||
|
||
COPY app.py requirements.txt ./ | ||
COPY model /opt/ml/model | ||
COPY requirements.txt ./ | ||
|
||
RUN python3.11 -m pip install -r requirements.txt -t . | ||
|
||
COPY model /opt/ml/model | ||
COPY app.py ./ | ||
|
||
CMD ["app.lambda_handler"] |
6 changes: 4 additions & 2 deletions
6
python3.11/apigw-scikit/{{cookiecutter.project_name}}/app/Dockerfile
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
FROM public.ecr.aws/lambda/python:3.11 | ||
|
||
COPY app.py requirements.txt ./ | ||
COPY model /opt/ml/model | ||
COPY requirements.txt ./ | ||
|
||
# temporarily install gcc so that scikit-learn can be built | ||
RUN yum install gcc-c++ -y | ||
|
||
RUN python3.11 -m pip install -r requirements.txt -t . | ||
|
||
COPY model /opt/ml/model | ||
COPY app.py ./ | ||
|
||
CMD ["app.lambda_handler"] |
6 changes: 4 additions & 2 deletions
6
python3.11/apigw-tensorflow/{{cookiecutter.project_name}}/app/Dockerfile
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
FROM public.ecr.aws/lambda/python:3.11 | ||
|
||
COPY app.py requirements.txt ./ | ||
COPY model /opt/ml/model | ||
COPY requirements.txt ./ | ||
|
||
RUN python3.11 -m pip install -r requirements.txt -t . | ||
|
||
COPY model /opt/ml/model | ||
COPY app.py ./ | ||
|
||
CMD ["app.lambda_handler"] |
6 changes: 4 additions & 2 deletions
6
python3.11/apigw-xgboost/{{cookiecutter.project_name}}/app/Dockerfile
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
FROM public.ecr.aws/lambda/python:3.11 | ||
|
||
COPY app.py requirements.txt ./ | ||
COPY model /opt/ml/model | ||
COPY requirements.txt ./ | ||
|
||
RUN python3.11 -m pip install -r requirements.txt -t . | ||
|
||
COPY model /opt/ml/model | ||
COPY app.py ./ | ||
|
||
CMD ["app.lambda_handler"] |
4 changes: 3 additions & 1 deletion
4
python3.11/hello-img/{{cookiecutter.project_name}}/hello_world/Dockerfile
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
FROM public.ecr.aws/lambda/python:3.11 | ||
|
||
COPY app.py requirements.txt ./ | ||
COPY requirements.txt ./ | ||
|
||
RUN {{cookiecutter.runtime}} -m pip install -r requirements.txt -t . | ||
|
||
COPY app.py ./ | ||
|
||
# Command can be overwritten by providing a different command in the template directly. | ||
CMD ["app.lambda_handler"] |