-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
37 lines (34 loc) · 1.22 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
FROM edoburu/django-base-images:py310-bullseye-build AS build-image
FROM python:3.10-slim-bullseye
ENV PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=off
# Install runtime dependencies.
# - curl for healthchecks
# - gettext for `manage.py compilemessages` (run here to avoid busting build-container cache layers)
# - postgresql-client for `manage.py dbshell`
# - mime-support for `uwsgi --http`
# - libxml for lxml
# - libpng, freetype, libtiff and jpeg2000 support for Pillow
# - skipped libjpeg62-turbo, as mozjpeg is used instead.
# Performing dist-upgrade in case base image is outdated.
RUN apt-get update \
&& apt-get dist-upgrade -y \
&& mkdir -p /usr/share/man/man1 /usr/share/man/man7 \
&& apt-get install --no-install-recommends -y \
libxml2 \
libpng16-16 \
libopenjp2-7 \
libfreetype6 \
libtiff5 \
libwebp6 \
libwebpmux3 \
libwebpdemux2 \
curl \
gettext \
mime-support \
postgresql-client \
&& rm -rf /var/lib/apt/lists/* /var/cache/debconf/*-old \
&& echo "font/woff2 woff2" >> /etc/mime.types \
&& echo "image/webp webp" >> /etc/mime.types \
&& useradd --system --user-group app
COPY --from=build-image /opt/mozjpeg /opt/mozjpeg