-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
74 lines (55 loc) · 1.06 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# node build
FROM node:12-slim AS builder
WORKDIR /receipt-split
# node
COPY ./src/ ./src/
COPY ./config/ ./config/
COPY ./public/ ./public/
COPY ./scripts/ ./scripts/
COPY [ \
"package-lock.json", \
"package.json", \
"static.json", \
"tsconfig.json", \
"./" \
]
# node
RUN npm ci
# react
ENV REACT_APP_API_URL_PRODUCTION=''
ENV NODE_ENV=production
RUN npm run build
# python build
FROM python:3.7-slim
# docker
WORKDIR /srv/receipt-split
# -- Start Vars --
ENV SECRET_KEY="999_DEBUG_CHANGE_IN_PROD_999"
ENV DB_URI="sqlite:////srv/receipt-split/app.db.sqlite3"
# flask
ENV WSGI_WORKERS=2
ENV FLASK_ENV=production
ENV FLASK_APP=receipt_split:app
# -- End Vars --
COPY --from=builder /receipt-split/build/ ./build
# python
COPY ./migrations/ ./migrations/
COPY ./receipt_split/ ./receipt_split/
COPY [ \
"docker-entrypoint.sh", \
"config.py", \
"Pipfile", \
"Pipfile.lock", \
"./" \
]
# python
RUN pip install pipenv
RUN pipenv install
CMD [ \
"bash", \
"-c", \
"./docker-entrypoint.sh \
--db-uri $DB_URI \
--secret-key $SECRET_KEY \
--wsgi-workers $WSGI_WORKERS" \
]