-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
61 lines (42 loc) · 1.21 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
FROM python:3.9-buster as builder
MAINTAINER [email protected]
ENV PYTHONUNBUFFERED 1
RUN apt update && apt install --no-install-recommends -y \
curl \
gdal-bin \
libgeos-c1v5 \
libpq5 \
netcat-openbsd \
build-essential \
libgeos-dev \
libpq-dev \
python3-dev \
libffi-dev
WORKDIR /app/
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt
# Start runtime image
FROM python:3.9-buster
RUN apt update && apt install --no-install-recommends -y \
gdal-bin \
libgeos-c1v5 \
libpq5 \
netcat-openbsd
# Copy python build artifacts from builder image
COPY --from=builder /usr/local/bin/ /usr/local/bin/
COPY --from=builder /usr/local/lib/python3.9/site-packages/ /usr/local/lib/python3.9/site-packages/
RUN adduser --system datapunt
ENV PYTHONUNBUFFERED 1
ARG BAG_OBJECTSTORE_PASSWORD
ENV BAG_OBJECTSTORE_PASSWORD=$BAG_OBJECTSTORE_PASSWORD
WORKDIR /app/
RUN chown datapunt -R /app
EXPOSE 8080
RUN mkdir -p /static && chown datapunt /static
ENV DJANGO_SETTINGS_MODULE=bag.settings.docker
COPY bag /app/
COPY .jenkins-import /.jenkins-import/
USER datapunt
ENV BAG_SECRET_KEY=insecure
RUN ./manage.py collectstatic
CMD /app/docker-entrypoint.sh