optimize docker build time

This commit is contained in:
Gabriel Augendre 2024-02-11 12:59:28 +01:00
parent 4e291bb212
commit 0c51954ddb

View file

@ -30,10 +30,6 @@ RUN apt-get update -y \
libxml2 \ libxml2 \
media-types media-types
# Fetch project requirements
##############################################
COPY --chown=django:django --from=git /git-describe /git-commit /build-date /app/git/
# Create directory structure # Create directory structure
############################################## ##############################################
WORKDIR /app WORKDIR /app
@ -53,6 +49,10 @@ RUN python -m pip install --no-cache-dir -r requirements.txt
WORKDIR /app/src WORKDIR /app/src
RUN python manage.py collectstatic --noinput --clear RUN python manage.py collectstatic --noinput --clear
# Copy git info
##############################################
COPY --chown=django:django --from=git /git-describe /git-commit /build-date /app/git/
EXPOSE 8000 EXPOSE 8000
WORKDIR /app/src WORKDIR /app/src