mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-29 21:14:03 +03:00
Changed when Requirements are copied and installed to improve incremental image build times. The extra image layer is inconsequential since python-build-stage layers are discarded anyway.
This commit is contained in:
parent
99ef9f44b9
commit
079db28661
|
@ -2,9 +2,6 @@
|
||||||
FROM python:3.8-slim-buster as python-build-stage
|
FROM python:3.8-slim-buster as python-build-stage
|
||||||
ENV PYTHONDONTWRITEBYTECODE 1
|
ENV PYTHONDONTWRITEBYTECODE 1
|
||||||
|
|
||||||
# Requirements are installed here to ensure they will be cached.
|
|
||||||
COPY ./requirements /requirements
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install --no-install-recommends -y \
|
RUN apt-get update && apt-get install --no-install-recommends -y \
|
||||||
# dependencies for building Python packages
|
# dependencies for building Python packages
|
||||||
build-essential \
|
build-essential \
|
||||||
|
@ -14,15 +11,19 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
|
||||||
gettext \
|
gettext \
|
||||||
# cleaning up unused files
|
# cleaning up unused files
|
||||||
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
|
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
# install python dependencies
|
|
||||||
&& pip install --no-cache-dir --use-feature=2020-resolver -r /requirements/local.txt \
|
# Requirements are installed here to ensure they will be cached.
|
||||||
&& rm -rf /requirements
|
COPY ./requirements /requirements
|
||||||
|
|
||||||
|
# install python dependencies
|
||||||
|
RUN pip install --no-cache-dir --use-feature=2020-resolver -r /requirements/local.txt \
|
||||||
|
&& rm -rf /requirements
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Python 'run' stage
|
# Python 'run' stage
|
||||||
FROM python:3.8-slim-buster
|
FROM python:3.8-slim-buster as python-run-stage
|
||||||
|
|
||||||
ENV PYTHONUNBUFFERED 1
|
ENV PYTHONUNBUFFERED 1
|
||||||
ENV PYTHONDONTWRITEBYTECODE 1
|
ENV PYTHONDONTWRITEBYTECODE 1
|
||||||
|
|
|
@ -13,9 +13,6 @@ RUN npm run build
|
||||||
FROM python:3.8-slim-buster as python-build-stage
|
FROM python:3.8-slim-buster as python-build-stage
|
||||||
ENV PYTHONDONTWRITEBYTECODE 1
|
ENV PYTHONDONTWRITEBYTECODE 1
|
||||||
|
|
||||||
# Requirements are installed here to ensure they will be cached.
|
|
||||||
COPY ./requirements /requirements
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install --no-install-recommends -y \
|
RUN apt-get update && apt-get install --no-install-recommends -y \
|
||||||
# dependencies for building Python packages
|
# dependencies for building Python packages
|
||||||
build-essential \
|
build-essential \
|
||||||
|
@ -25,14 +22,17 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
|
||||||
gettext \
|
gettext \
|
||||||
# cleaning up unused files
|
# cleaning up unused files
|
||||||
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
|
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
# install python dependencies
|
|
||||||
&& pip install --no-cache-dir --use-feature=2020-resolver -r /requirements/production.txt \
|
|
||||||
&& rm -rf /requirements
|
|
||||||
|
|
||||||
|
# Requirements are installed here to ensure they will be cached.
|
||||||
|
COPY ./requirements /requirements
|
||||||
|
|
||||||
|
# install python dependencies
|
||||||
|
Run pip install --no-cache-dir --use-feature=2020-resolver -r /requirements/production.txt \
|
||||||
|
&& rm -rf /requirements
|
||||||
|
|
||||||
# Python 'run' stage
|
# Python 'run' stage
|
||||||
FROM python:3.8-slim-buster
|
FROM python:3.8-slim-buster as python-run-stage
|
||||||
|
|
||||||
ENV PYTHONDONTWRITEBYTECODE 1
|
ENV PYTHONDONTWRITEBYTECODE 1
|
||||||
ENV PYTHONUNBUFFERED 1
|
ENV PYTHONUNBUFFERED 1
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FROM traefik:v2.0
|
FROM traefik:v2.2.11
|
||||||
RUN mkdir -p /etc/traefik/acme \
|
RUN mkdir -p /etc/traefik/acme \
|
||||||
&& touch /etc/traefik/acme/acme.json \
|
&& touch /etc/traefik/acme/acme.json \
|
||||||
&& chmod 600 /etc/traefik/acme/acme.json
|
&& chmod 600 /etc/traefik/acme/acme.json
|
||||||
|
|
Loading…
Reference in New Issue
Block a user