-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
45 lines (36 loc) · 1.24 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
# Build frontend
FROM node:16.14.0-alpine as frontend-build
COPY txmatching/web/frontend ./frontend
WORKDIR ./frontend
RUN npm i
RUN npm run build-prod
# Build backend
FROM ghcr.io/mild-blue/txmatching-conda-dependencies:1.0.29 AS backend-build
LABEL description="Mild Blue - TXMatching"
LABEL project="mildblue:txmatching"
WORKDIR /app
# check that the base image has same conda as the repo
COPY conda.yml conda.yml.repo
RUN diff --strip-trailing-cr conda.yml conda.yml.repo
# Do all your magic from here
# Copy rest of the app
COPY txmatching ./txmatching
RUN mkdir -p /logs
# Copy pre-built frontend
COPY --from=frontend-build ./frontend/dist/frontend /app/txmatching/web/frontend/dist/frontend
# Create version file
ARG release_version=development-docker
ENV RELEASE_FILE_PATH=/app/release.txt
RUN echo $release_version > $RELEASE_FILE_PATH
ENV PORT=8080
# Start the app - one must initialize shell beforehand
CMD . ~/.bashrc && \
conda activate txmatching && \
gunicorn \
--config txmatching/web/gunicorn_configuration.py \
# to get rid of non-json logs at the beggining
--log-level 'warning' \
--bind 0.0.0.0:${PORT} \
--timeout 1800 \
--graceful-timeout 1800 \
txmatching.web.app:app