Update dockerfile to cache package installs before copying in code
This commit is contained in:
parent
cb0377a8eb
commit
5607664397
1 changed files with 11 additions and 5 deletions
|
@ -48,12 +48,14 @@ RUN apk --no-cache add \
|
||||||
&& pip3 install --no-cache-dir --disable-pip-version-check \
|
&& pip3 install --no-cache-dir --disable-pip-version-check \
|
||||||
pytest-pgsql \
|
pytest-pgsql \
|
||||||
freezegun \
|
freezegun \
|
||||||
&& apk --no-cache del py3-pip \
|
&& apk --no-cache del py3-pip
|
||||||
&& addgroup app \
|
|
||||||
|
COPY ./ /opt/app/
|
||||||
|
|
||||||
|
RUN addgroup app \
|
||||||
&& adduser -SDH -h /opt/app -g '' -G app app \
|
&& adduser -SDH -h /opt/app -g '' -G app app \
|
||||||
&& chown app:app /opt/app
|
&& chown app:app /opt/app
|
||||||
|
|
||||||
COPY --chown=app:app ./szurubooru/tests /opt/app/szurubooru/tests/
|
|
||||||
|
|
||||||
ENV TEST_ENVIRONMENT="true"
|
ENV TEST_ENVIRONMENT="true"
|
||||||
USER app
|
USER app
|
||||||
|
@ -70,8 +72,12 @@ ARG PGID=1000
|
||||||
RUN apk --no-cache add \
|
RUN apk --no-cache add \
|
||||||
dumb-init \
|
dumb-init \
|
||||||
py3-setuptools \
|
py3-setuptools \
|
||||||
py3-waitress \
|
py3-waitress
|
||||||
&& mkdir -p /opt/app /data \
|
|
||||||
|
|
||||||
|
COPY ./ /opt/app/
|
||||||
|
|
||||||
|
RUN mkdir -p /opt/app /data \
|
||||||
&& addgroup -g ${PGID} app \
|
&& addgroup -g ${PGID} app \
|
||||||
&& adduser -SDH -h /opt/app -g '' -G app -u ${PUID} app \
|
&& adduser -SDH -h /opt/app -g '' -G app -u ${PUID} app \
|
||||||
&& chown -R app:app /opt/app /data
|
&& chown -R app:app /opt/app /data
|
||||||
|
|
Loading…
Reference in a new issue