-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
44 lines (30 loc) · 1.19 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
38
39
40
41
42
43
44
ARG PYTHON_VERSION=3.6
ARG IMAGE_VARIANT=slim
# ==============================
FROM helsinkitest/python:${PYTHON_VERSION}-${IMAGE_VARIANT} AS base_stage
# ==============================
ENV PYTHONDONTWRITEBYTECODE true
ENV PYTHONUNBUFFERED true
# Add tini init system https://github.com/krallin/tini
ENV TINI_VERSION v0.18.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
EXPOSE 8000
COPY --chown=appuser:appuser ./docker/django/docker-entrypoint.sh /app/
ENTRYPOINT ["/tini", "--", "/app/docker/django/docker-entrypoint.sh"]
COPY --chown=appuser:appuser requirements.txt /app/
RUN apt-install.sh build-essential gdal-bin gettext \
&& pip install --no-cache-dir -r /app/requirements.txt \
&& apt-cleanup.sh build-essential
# ==============================
FROM base_stage AS development
# ==============================
COPY --chown=appuser:appuser requirements-dev.txt /app/
RUN pip --no-cache-dir install -r /app/requirements-dev.txt
COPY --chown=appuser:appuser . /app/
USER appuser:appuser
# ==============================
FROM base_stage AS production
# ==============================
COPY --chown=appuser:appuser . /app/
USER appuser:appuser