forked from City-of-Helsinki/smbackend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
31 lines (22 loc) · 1.01 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
# Using Ubuntu base for access to GDAL PPA
FROM ubuntu:20.04
WORKDIR /smbackend
# tzdata installation requires settings frontend
RUN apt-get update && \
TZ="Europe/Helsinki" DEBIAN_FRONTEND=noninteractive apt-get install -y python3-pip gdal-bin uwsgi uwsgi-plugin-python3 libgdal26 postgresql-client netcat gettext git-core libpq-dev && \
ln -s /usr/bin/pip3 /usr/local/bin/pip && \
ln -s /usr/bin/python3 /usr/local/bin/python
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
# smbackend needs only static files, media is not used
ENV STATIC_ROOT /srv/smbackend/static
RUN mkdir -p /srv/smbackend/static
RUN python manage.py compilemessages
RUN python manage.py collectstatic
# Munigeo will fetch data to this directory
RUN mkdir -p /smbackend/data && chgrp -R 0 /smbackend/data && chmod -R g+w /smbackend/data
# Openshift starts the container process with group zero and random ID
# we mimic that here with nobody and group zero
USER nobody:0
ENTRYPOINT ["./docker-entrypoint.sh"]