Differences between revisions 1 and 2
Revision 1 as of 2019-03-25 05:47:29
Size: 369
Editor: PieterSmit
Comment:
Revision 2 as of 2019-03-25 09:41:07
Size: 556
Editor: PieterSmit
Comment:
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
 * Run python script in docker envelope {{{
$ docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp python:3 python
}}}
Line 3: Line 6:
 * Python docker build file

Docker Python build file

  • Run python script in docker envelope

    $ docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp python:3 python 
  • Python docker build file

FROM python:3.7-alpine as base
FROM base as builder
RUN mkdir /install
WORKDIR /install
COPY requirements.txt /requirements.txt
RUN pip install --install-option="--prefix=/install" -r /requirements.txt
FROM base
COPY --from=builder /install /usr/local
COPY src /app
WORKDIR /app
CMD ["gunicorn", "-w 4", "main:app"]

docker/Python (last edited 2020-04-06 19:31:13 by PieterSmit)