-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
44 lines (29 loc) · 1.03 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 UBUNTU_VERSION=20.04
FROM ubuntu:${UBUNTU_VERSION}
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV OPTIMAP_DEBUG=False
ENV OPTIMAP_ALLOWED_HOST=*
ENV DEBIAN_FRONTEND="noninteractive" TZ="Europe/Berlin"
# TODO: see https://www.joseferben.com/posts/django-on-flyio/ for more improvements
# install Python
RUN apt-get update && \
apt-get install -y -qq python-is-python3 && \
apt-get install -y -qq python3-pip
# install GDAL from UbuntuGIS
RUN apt-get update && \
apt-get install -y -qq software-properties-common && \
add-apt-repository ppa:ubuntugis/ppa && \
apt-get install -y -qq gdal-bin libgdal-dev python3-gdal
RUN mkdir -p /code
WORKDIR /code
COPY requirements.txt /tmp/requirements.txt
RUN set -ex && \
pip install --upgrade pip && \
pip install -r /tmp/requirements.txt && \
rm -rf /root/.cache/
COPY . /code/
RUN python manage.py collectstatic --noinput
EXPOSE 8000
# replace demo.wsgi with <project_name>.wsgi
CMD ["gunicorn", "--bind", ":8000", "--workers", "2", "optimetaPortal.wsgi"]