-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
35 lines (22 loc) · 946 Bytes
/
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
###############################################################################
# TARGET: build
###############################################################################
FROM python:3.8-slim-buster AS build
WORKDIR app
COPY requirements.txt ./
RUN python3 -m pip install --upgrade pip && \
python3 -m pip install -r requirements.txt && \
find . -name "*.pyc" -delete
###############################################################################
# TARGET: service
###############################################################################
FROM build AS service
COPY main.py ./
CMD ["python3", "main.py"]
###############################################################################
# TARGET: test
###############################################################################
FROM build AS test
COPY requirements-test.txt ./
RUN python3 -m pip install -r requirements-test.txt
COPY main.py test.py test.txt ./