-
Notifications
You must be signed in to change notification settings - Fork 24
/
Dockerfile.justice-counts
43 lines (33 loc) · 1.52 KB
/
Dockerfile.justice-counts
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
FROM node:16-alpine as justice-counts-build
# e.g. https://github.com/Recidiviz/justice-counts/archive/<branch name>.tar.gz or
# https://github.com/Recidiviz/justice-counts/archive/refs/tags/<tag name>.tar.gz
ARG FRONTEND_URL=""
ADD ${FRONTEND_URL} frontend.tar.gz
RUN mkdir /justice-counts
RUN tar xvfz frontend.tar.gz -C /justice-counts --strip-components 1
# Build Publisher
WORKDIR /justice-counts/publisher
RUN yarn config set network-timeout 300000
RUN yarn
RUN yarn build
# Build Agency Dashboard
WORKDIR /justice-counts/agency-dashboard
RUN yarn config set network-timeout 300000
RUN yarn
RUN yarn build
FROM us-central1-docker.pkg.dev/justice-counts-staging/recidiviz-base-images/recidiviz-base:latest
WORKDIR /app/recidiviz
# Add the rest of the application code once all dependencies are installed
COPY . /app
COPY gunicorn.justice-counts.conf.py /app/gunicorn.conf.py
WORKDIR /app
# Add both built Justice Counts frontends to the image
COPY --from=justice-counts-build /justice-counts/publisher/build /app/frontends/justice-counts/publisher/build
COPY --from=justice-counts-build /justice-counts/agency-dashboard/build /app/frontends/justice-counts/agency-dashboard/build
# This makes docker not report that our container is healthy until the flask workers are
# started and returning 200 on the `/health` endpoint. This is initially only used by
# our docker-test Github Action.
HEALTHCHECK --interval=5s --timeout=3s \
CMD curl -f http://localhost:8080/health || exit 1
RUN rm -rf /var/lib/apt/lists/*; \
apt-get clean;