Merge pull request #28 from infosiftr/python-onbuild
Changed python documentation to use the onbuild example
This commit is contained in:
commit
ea1c4209e9
|
|
@ -15,18 +15,19 @@ Windows 2000 and later.
|
||||||
|
|
||||||
## Create a `Dockerfile` in your Python app project
|
## Create a `Dockerfile` in your Python app project
|
||||||
|
|
||||||
FROM python:3
|
FROM python:3-onbuild
|
||||||
COPY . /usr/src/myapp
|
|
||||||
WORKDIR /usr/src/myapp
|
|
||||||
CMD [ "python", "./your-daemon-or-script.py" ]
|
CMD [ "python", "./your-daemon-or-script.py" ]
|
||||||
|
|
||||||
or (if you need to use Python 2):
|
or (if you need to use Python 2):
|
||||||
|
|
||||||
FROM python:2
|
FROM python:2-onbuild
|
||||||
COPY . /usr/src/myapp
|
|
||||||
WORKDIR /usr/src/myapp
|
|
||||||
CMD [ "python", "./your-daemon-or-script.py" ]
|
CMD [ "python", "./your-daemon-or-script.py" ]
|
||||||
|
|
||||||
|
These images include multiple `ONBUILD` triggers, which should be all you need
|
||||||
|
to bootstrap most applications. The build will `COPY` a `requirements.txt` file,
|
||||||
|
`RUN pip install` on said file, and then copy the current directory into
|
||||||
|
`/usr/src/app`.
|
||||||
|
|
||||||
You can then build and run the Docker image:
|
You can then build and run the Docker image:
|
||||||
|
|
||||||
docker build -t my-python-app
|
docker build -t my-python-app
|
||||||
|
|
|
||||||
|
|
@ -22,18 +22,19 @@ Windows 2000 and later.
|
||||||
|
|
||||||
## Create a `Dockerfile` in your Python app project
|
## Create a `Dockerfile` in your Python app project
|
||||||
|
|
||||||
FROM python:3
|
FROM python:3-onbuild
|
||||||
COPY . /usr/src/myapp
|
|
||||||
WORKDIR /usr/src/myapp
|
|
||||||
CMD [ "python", "./your-daemon-or-script.py" ]
|
CMD [ "python", "./your-daemon-or-script.py" ]
|
||||||
|
|
||||||
or (if you need to use Python 2):
|
or (if you need to use Python 2):
|
||||||
|
|
||||||
FROM python:2
|
FROM python:2-onbuild
|
||||||
COPY . /usr/src/myapp
|
|
||||||
WORKDIR /usr/src/myapp
|
|
||||||
CMD [ "python", "./your-daemon-or-script.py" ]
|
CMD [ "python", "./your-daemon-or-script.py" ]
|
||||||
|
|
||||||
|
These images include multiple `ONBUILD` triggers, which should be all you need
|
||||||
|
to bootstrap most applications. The build will `COPY` a `requirements.txt` file,
|
||||||
|
`RUN pip install` on said file, and then copy the current directory into
|
||||||
|
`/usr/src/app`.
|
||||||
|
|
||||||
You can then build and run the Docker image:
|
You can then build and run the Docker image:
|
||||||
|
|
||||||
docker build -t my-python-app
|
docker build -t my-python-app
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue