-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
47 lines (30 loc) · 1.21 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Building stage (host OS)
FROM python:3.8 AS base
# set the working directory in the container
WORKDIR /app
# Upgrade pip
RUN python -m pip install --upgrade --no-cache-dir pip
# copy the dependencies file to the working directory
COPY requirements.txt .
# https://docs.python.org/3/using/cmdline.html#envvar-PYTHONUSERBASE
# PYTHONUSERBASE is used to compute the path of the user site-packages
RUN PYTHONUSERBASE=/install pip install --user -r requirements.txt
FROM base AS dev
# PYTHONUSERBASE is used to compute the path of the user site-packages
ENV PYTHONUSERBASE=/install
# copy the dependencies file to the working directory
COPY requirements-dev.txt .
# install dependencies
RUN pip install -r requirements-dev.txt
# copy the content of the local src directory to the working directory
COPY . ./
ENTRYPOINT watchmedo auto-restart --recursive --pattern="*.py" --directory="." -- python -m ivrflow
FROM python:3.8-slim AS runtime
# set the working directory in the container
WORKDIR /app
# copy the content of the local src directory to the working directory
COPY . ./
# copy the dependencies downloaded
COPY --from=base /install /usr/local
# command to run on container start
CMD [ "python", "-m", "ivrflow" ]