aboutsummaryrefslogtreecommitdiffstats
path: root/static-builds/Dockerfile
blob: a70165a02430cebab0705b5c13ee7be2eb9a1d92 (plain) (blame)
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
# Build a static preview of the site
FROM --platform=linux/amd64 python:3.9-slim-buster

# Allow service to handle stops gracefully
STOPSIGNAL SIGQUIT

# Set pip to have cleaner logs and no saved cache
ENV PIP_NO_CACHE_DIR=false \
    POETRY_VIRTUALENVS_CREATE=false

# Install poetry
RUN pip install -U poetry

# Copy the project files into working directory
WORKDIR /app

# Install project dependencies
COPY pyproject.toml poetry.lock ./
RUN poetry install --no-dev

ARG git_sha="development"
ENV GIT_SHA=$git_sha
ENV PARENT_HOST=replace_me.host

# Copy the source code in last to optimize rebuilding the image
COPY . .

RUN SECRET_KEY=dummy_value python manage.py distill-local build --traceback --force --collectstatic