-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile
51 lines (36 loc) · 1.39 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
# gunicorn-flask
# requires this ubuntu version due to protobuf library update
FROM ubuntu:18.04
MAINTAINER Nils Nolde <nils@openrouteservice.org>
RUN apt-get update
RUN apt-get install -y locales git python3-venv
# Set the locale
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# oes/flask variables
ENV OES_LOGLEVEL INFO
ENV FLASK_APP manage
ENV FLASK_ENV production
ENV APP_SETTINGS openelevationservice.server.config.ProductionConfig
# tzdata is being annoying otherwise
RUN /bin/bash -c "DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata"
RUN ln -fs /usr/share/zoneinfo/Europe/Berlin /etc/localtime
RUN dpkg-reconfigure --frontend noninteractive tzdata
# Needs postgis installation locally for raster2pgsql
RUN apt-get install -y postgis
# Setup flask application
RUN mkdir -p /deploy/app
COPY gunicorn_config.py /deploy/gunicorn_config.py
COPY manage.py /deploy/app/manage.py
COPY requirements.txt /deploy/app/requirements.txt
RUN python3 -m venv /oes_venv
RUN /bin/bash -c "source /oes_venv/bin/activate"
RUN /oes_venv/bin/pip3 install -r /deploy/app/requirements.txt
COPY openelevationservice /deploy/app/openelevationservice
COPY ops_settings_docker.yml /deploy/app/openelevationservice/server/ops_settings.yml
WORKDIR /deploy/app
EXPOSE 5000
# Start gunicorn
CMD ["/oes_venv/bin/gunicorn", "--config", "/deploy/gunicorn_config.py", "manage:app"]