Skip to content

Commit 27e4cd7

Browse files
committed
fixup docker files
1 parent 3841bbe commit 27e4cd7

File tree

2 files changed

+40
-2
lines changed

2 files changed

+40
-2
lines changed

Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
1616
set -x \
1717
&& apt-get update \
1818
&& apt-get install --no-install-recommends -y \
19-
pandoc \
2019
texlive-latex-base \
2120
texlive-latex-recommended \
2221
texlive-fonts-recommended \
@@ -35,6 +34,8 @@ WORKDIR /code
3534

3635
COPY dev-requirements.txt /code/
3736
COPY base-requirements.txt /code/
37+
COPY prod-requirements.txt /code/
38+
COPY requirements.txt /code/
3839

3940
RUN pip --no-cache-dir --disable-pip-version-check install --upgrade pip setuptools wheel
4041

Dockerfile.cabotage

+38-1
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,48 @@ FROM python:3.9-bullseye
22
COPY --from=ewdurbin/nginx-static:1.25.x /usr/bin/nginx /usr/bin/nginx
33
ENV PYTHONUNBUFFERED=1
44
ENV PYTHONDONTWRITEBYTECODE=1
5+
6+
# By default, Docker has special steps to avoid keeping APT caches in the layers, which
7+
# is good, but in our case, we're going to mount a special cache volume (kept between
8+
# builds), so we WANT the cache to persist.
9+
RUN set -eux; \
10+
rm -f /etc/apt/apt.conf.d/docker-clean; \
11+
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache;
12+
13+
# Install System level build requirements, this is done before
14+
# everything else because these are rarely ever going to change.
15+
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
16+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
17+
set -x \
18+
&& apt-get update \
19+
&& apt-get install --no-install-recommends -y \
20+
texlive-latex-base \
21+
texlive-latex-recommended \
22+
texlive-fonts-recommended \
23+
texlive-plain-generic \
24+
lmodern
25+
26+
RUN case $(uname -m) in \
27+
"x86_64") ARCH=amd64 ;; \
28+
"aarch64") ARCH=arm64 ;; \
29+
esac \
30+
&& wget --quiet https://github.com/jgm/pandoc/releases/download/2.17.1.1/pandoc-2.17.1.1-1-${ARCH}.deb \
31+
&& dpkg -i pandoc-2.17.1.1-1-${ARCH}.deb
32+
533
RUN mkdir /code
634
WORKDIR /code
35+
36+
COPY dev-requirements.txt /code/
737
COPY base-requirements.txt /code/
838
COPY prod-requirements.txt /code/
939
COPY requirements.txt /code/
10-
RUN pip install -r requirements.txt
40+
41+
RUN pip --no-cache-dir --disable-pip-version-check install --upgrade pip setuptools wheel
42+
43+
RUN --mount=type=cache,target=/root/.cache/pip \
44+
set -x \
45+
&& pip --disable-pip-version-check \
46+
install \
47+
-r requirements.txt -r prod-requirements.txt
1148
COPY . /code/
1249
RUN DJANGO_SETTINGS_MODULE=pydotorg.settings.static python manage.py collectstatic --noinput

0 commit comments

Comments
 (0)