-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathDockerfile
55 lines (38 loc) · 1.13 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
# ==============================
FROM helsinki.azurecr.io/ubi9/python-312-gdal AS appbase
# ==============================
WORKDIR /app
USER root
COPY requirements.txt .
RUN dnf update -y && dnf install -y \
nmap-ncat \
gettext \
postgresql \
&& pip install -U pip setuptools wheel \
&& pip install --no-cache-dir -r requirements.txt \
&& dnf clean all
# Munigeo will fetch data to this directory
RUN mkdir -p /app/data && chgrp -R 0 /app/data && chmod -R g+w /app/data
ENTRYPOINT ["./docker-entrypoint.sh"]
EXPOSE 8000/tcp
# ==============================
FROM appbase AS development
# ==============================
ENV DEV_SERVER=True
COPY requirements-dev.txt .
RUN pip install --no-cache-dir -r requirements-dev.txt
COPY . .
USER default
# ==============================
FROM appbase AS staticbuilder
# ==============================
ENV STATIC_ROOT /app/static
COPY . .
RUN python manage.py collectstatic
# ==============================
FROM appbase AS production
# ==============================
COPY --from=staticbuilder /app/static /app/static
COPY . .
RUN python manage.py compilemessages
USER default