Skip to content

Commit c5b3bd5

Browse files
committed
Split build stages into core and production
1 parent c37752a commit c5b3bd5

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Dockerfile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ RUN apk add --no-cache \
3939
libffi \
4040
openssl \
4141
pango \
42-
# fonts
43-
ttf-opensans \
44-
ttf-dejavu \
45-
ghostscript-fonts \
4642
# Used as the entrypoint
4743
tini \
4844
# curl is needed for the status check
@@ -91,7 +87,7 @@ COPY . .
9187
ARG GITHUB_SHA
9288
ENV SENTRY_RELEASE=$GITHUB_SHA
9389

94-
FROM builder AS production
90+
FROM builder AS core
9591
# Named stage so it can be optimized in the future. (Stage name is referenced by CI build script.)
9692

9793
COPY pdf_service ./pdf_service
@@ -105,3 +101,12 @@ HEALTHCHECK --interval=2s --timeout=2s --retries=5 --start-period=2s CMD curl --
105101

106102
CMD tini gunicorn -w $WORKER_COUNT -t 0 -b 0.0.0.0:8080 pdf_service:pdf_service
107103
EXPOSE 8080
104+
105+
FROM core AS production
106+
107+
USER root
108+
RUN apk add --no-cache \
109+
ttf-opensans \
110+
ttf-dejavu \
111+
ghostscript-fonts
112+
USER pdf_service_user

0 commit comments

Comments
 (0)