forked from altixco/django-postgres-dokku
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
36 lines (28 loc) · 1.08 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
# Use an official Python runtime based on Debian 10 "buster" as a parent image.
FROM python:3.9-slim-bullseye
# Set environment variables.
# 1. Force Python stdout and stderr streams to be unbuffered.
ENV PYTHONUNBUFFERED=1
# Install system packages required by Wagtail and Django.
RUN apt-get update --yes --quiet && apt-get install --yes --quiet --no-install-recommends \
build-essential \
libpq-dev \
libjpeg62-turbo-dev \
zlib1g-dev \
libwebp-dev \
gettext \
&& rm -rf /var/lib/apt/lists/*
# Add group:user that will be used in the container.
RUN groupadd --gid 2000 wagtail
RUN useradd --uid 2000 --gid wagtail --create-home wagtail
# Use /src folder as a directory where the source code is stored.
WORKDIR /src
# Set this directory to be owned by the "wagtail" user.
RUN chown wagtail:wagtail /src
# Python dependencies
COPY requirements.txt /src/
RUN pip install -r /src/requirements.txt
# Copy the source code of the project into the container.
COPY --chown=wagtail:wagtail . /src
# Use user "wagtail" to run the build commands and the server itself.
USER wagtail