forked from City-of-Helsinki/smbackend
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
34 lines (24 loc) · 1.06 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
# Using Ubuntu base for access to GDAL PPA
FROM ubuntu:20.04
FROM python:3.10.4
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 libgdal-dev postgresql-client netcat gettext git-core libpq-dev voikko-fi libvoikko-dev
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
# smbackend needs static files and media for data sources
ENV STATIC_ROOT /srv/smbackend/static
RUN mkdir -p /ssmbackend/static
ENV MEDIA_ROOT /srv/smbackend/media
RUN mkdir -p /srv/smbackend/media
ENV SECRET_KEY "only-for-build"
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"]