blob: a686815c77ba4803ef3f2a92ad335e4ab10672fc [file] [log] [blame]
magnussonl2ec08082020-05-01 10:43:30 +02001# Copyright 2020 Arctos Labs Scandinavia AB
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12# implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16FROM ubuntu:18.04
17
18LABEL authors="Lars-Göran Magnusson"
19
20RUN apt-get --yes update \
21 && apt-get --yes install git python python-pip python3 python3-pip libmysqlclient-dev libssl-dev libffi-dev \
22 && apt-get --yes install mysql-client curl software-properties-common libgl1-mesa-glx \
23 && pip3 install pip==9.0.3
24
25ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
26ARG RELEASE=ReleaseFOUR-daily
27ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg
28ARG REPOSITORY=testing
29
30RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add -
31RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} PLA common" && apt update
32
33ARG PLA_VERSION
34ARG COMMON_VERSION
35
36RUN apt-get --yes update && apt-get -y install python3-osm-common${COMMON_VERSION} python3-osm-pla${PLA_VERSION}
37
38COPY scripts/ scripts/
39
magnussonld0420fb2020-07-02 19:32:36 +020040ADD https://github.com/MiniZinc/MiniZincIDE/releases/download/2.4.2/MiniZincIDE-2.4.2-bundle-linux-x86_64.tgz /minizinc.tgz
41
42RUN tar -zxf /minizinc.tgz && \
43 mv /MiniZincIDE-2.4.2-bundle-linux /minizinc
44
45RUN mkdir /entry_data \
46 && mkdir /entry_data/mzn-lib \
47 && ln -s /entry_data/mzn-lib /minizinc/share/minizinc/exec
48
49RUN mkdir /placement
50
magnussonl2ec08082020-05-01 10:43:30 +020051ENV OSMPLA_MESSAGE_DRIVER kafka
52ENV OSMPLA_MESSAGE_HOST kafka
53ENV OSMPLA_MESSAGE_PORT 9092
54
55ENV OSMPLA_DATABASE_DRIVER mongo
56ENV OSMPLA_DATABASE_URI mongodb://mongo:27017
57
58ENV OSMPLA_SQL_DATABASE_URI sqlite:///pla_sqlite.db
59
60ENV OSMPLA_GLOBAL_LOG_LEVEL INFO
61
62ENV FZNEXEC "/entry_data/fzn-exec"
63ENV PATH "/minizinc/bin:${PATH}"
64ENV LD_LIBRARY_PATH "/minizinc/lib:${LD_LIBRARY_PATH}"
65
66# No healtcheck yet...
67#HEALTHCHECK --start-period=120s --interval=10s --timeout=5s --retries=5 \
68# CMD osm-pla-healthcheck || exit 1
69
70CMD /bin/bash scripts/start.sh