-
Notifications
You must be signed in to change notification settings - Fork 24
/
Dockerfile
executable file
·56 lines (33 loc) · 864 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
FROM python:3-alpine AS base
WORKDIR /app
RUN pip install pipenv==2018.10.13
COPY Pipfile /app/
COPY Pipfile.lock /app/
RUN pipenv install --system --deploy
FROM base AS app
COPY src /app
FROM base AS test-base
RUN pipenv install --system --deploy --dev
COPY src /app
FROM test-base AS Test
RUN pytest --black
FROM test-base AS Check
RUN safety check
FROM app AS Security
ARG MICROSCANNER
RUN wget -O /microscanner https://get.aquasec.com/microscanner && chmod +x /microscanner
RUN /microscanner $MICROSCANNER --full-output
FROM test-base AS Docs
RUN pycco -i *.py*
WORKDIR /app/docs
EXPOSE 8000
CMD ["python", "-m", "http.server"]
FROM app AS Shell
CMD ["flask", "shell"]
FROM app AS release
EXPOSE 5000
CMD ["python", "app.py"]
FROM release AS Dev
ENV FLASK_ENV=development
FROM release As Prod
CMD ["gunicorn", "-b", ":5000", "app:app"]