Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b983c72

Browse files
committed
Set default ENTRYPOINT in python-runtime
Set the ENTRYPOINT in python-runtime to run a default /app/main.py file. This behavior can be changed by overriding ENTRYPOINT in the application Dockerfile.
1 parent c375a3c commit b983c72

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

app/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
FROM google/python-runtime
2-
ENTRYPOINT ["/env/bin/python", "/app/main.py"]

runtime/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ ONBUILD ADD . /app
88

99
EXPOSE 8080
1010
CMD []
11+
ENTRYPOINT ["/env/bin/python", "main.py"]

runtime/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ It is based on [`google/python`](https://index.docker.io/u/google/python) base i
99
- Create a Dockerfile in your python application directory with the following content:
1010

1111
FROM google/python-runtime
12-
ENTRYPOINT ['/env/bin/python', '/app/main.py']
1312

1413
- Run the following command in your application directory:
1514

@@ -24,7 +23,9 @@ It is based on [`google/python`](https://index.docker.io/u/google/python) base i
2423

2524
The image assumes that your application:
2625

27-
- has a [`requirements.txt`](https://pip.pypa.io/en/latest/user_guide.html#requirements-files) file to specify its dependencies.
26+
- has a [`requirements.txt`](https://pip.pypa.io/en/latest/user_guide.html#requirements-files) file to specify its dependencies
2827
- listens on port `8080`
28+
- either has a `main.py` script as entrypoint or defines `ENTRYPOINT ["/env/bin/python", "/app/some_other_file.py"]` in its `Dockerfile`
29+
2930

3031
When building your application docker image, dependencies of your application are automatically fetched in a virtualenv using `pip install`.

0 commit comments

Comments
 (0)