Optimize build caching
Before this commit, if docker-entrypoint or any file in mailman-web changed, the Docker build cache would not be used, so the install of dependencies would run again, uselessly
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
# syntax = docker/dockerfile:1.3
|
||||
FROM alpine:3.18.4
|
||||
|
||||
# Add needed files for uwsgi server + settings for django
|
||||
COPY mailman-web /opt/mailman-web
|
||||
# Add startup script to container
|
||||
COPY docker-entrypoint.sh /usr/local/bin/
|
||||
# Add requirements file.
|
||||
COPY requirements.txt /tmp/
|
||||
|
||||
@@ -34,8 +30,14 @@ RUN --mount=type=cache,target=/root/.cache \
|
||||
tzdata \
|
||||
&& apk del .build-deps \
|
||||
&& addgroup -S mailman \
|
||||
&& adduser -S -G mailman mailman \
|
||||
&& chown -R mailman /opt/mailman-web/ \
|
||||
&& adduser -S -G mailman mailman
|
||||
|
||||
# Add needed files for uwsgi server + settings for django
|
||||
COPY mailman-web /opt/mailman-web
|
||||
# Add startup script to container
|
||||
COPY docker-entrypoint.sh /usr/local/bin/
|
||||
|
||||
RUN chown -R mailman /opt/mailman-web/ \
|
||||
&& chmod u+x /opt/mailman-web/manage.py
|
||||
|
||||
WORKDIR /opt/mailman-web
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
# syntax = docker/dockerfile:1.3
|
||||
FROM alpine:3.18.4
|
||||
|
||||
# Add needed files for uwsgi server + settings for django
|
||||
COPY mailman-web /opt/mailman-web
|
||||
# Add startup script to container
|
||||
COPY docker-entrypoint.sh /usr/local/bin/
|
||||
|
||||
ARG POSTORIUS_REF
|
||||
ARG HYPERKITTY_REF
|
||||
ARG DJ_MM3_REF
|
||||
@@ -42,9 +37,15 @@ RUN --mount=type=cache,target=/root/.cache \
|
||||
git+https://gitlab.com/mailman/django-mailman3 \
|
||||
&& apk del .build-deps \
|
||||
&& addgroup -S mailman \
|
||||
&& adduser -S -G mailman mailman \
|
||||
&& chown -R mailman /opt/mailman-web/ \
|
||||
&& chmod u+x /opt/mailman-web/manage.py
|
||||
&& adduser -S -G mailman mailman
|
||||
|
||||
# Add needed files for uwsgi server + settings for django
|
||||
COPY mailman-web /opt/mailman-web
|
||||
# Add startup script to container
|
||||
COPY docker-entrypoint.sh /usr/local/bin/
|
||||
|
||||
RUN chown -R mailman /opt/mailman-web/ \
|
||||
&& chmod u+x /opt/mailman-web/manage.py
|
||||
|
||||
WORKDIR /opt/mailman-web
|
||||
|
||||
|
||||
Reference in New Issue
Block a user