| magnussonl | 2ec0808 | 2020-05-01 10:43:30 +0200 | [diff] [blame] | 1 | # 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 | |
| 16 | FROM ubuntu:18.04 |
| 17 | |
| 18 | LABEL authors="Lars-Göran Magnusson" |
| 19 | |
| 20 | RUN 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 \ |
| magnussonl | d6d60fc | 2020-07-06 16:44:04 +0200 | [diff] [blame] | 23 | && python3 -m pip install -U pip \ |
| 24 | && python3 -m pip install pymzn==0.18.3 |
| magnussonl | 2ec0808 | 2020-05-01 10:43:30 +0200 | [diff] [blame] | 25 | |
| 26 | ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian |
| beierlm | a4a37f7 | 2020-06-26 12:55:01 -0400 | [diff] [blame] | 27 | ARG RELEASE=ReleaseEIGHT-daily |
| magnussonl | 2ec0808 | 2020-05-01 10:43:30 +0200 | [diff] [blame] | 28 | ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg |
| 29 | ARG REPOSITORY=testing |
| 30 | |
| 31 | RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add - |
| 32 | RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} PLA common" && apt update |
| 33 | |
| 34 | ARG PLA_VERSION |
| 35 | ARG COMMON_VERSION |
| 36 | |
| 37 | RUN apt-get --yes update && apt-get -y install python3-osm-common${COMMON_VERSION} python3-osm-pla${PLA_VERSION} |
| 38 | |
| 39 | COPY scripts/ scripts/ |
| 40 | |
| magnussonl | d0420fb | 2020-07-02 19:32:36 +0200 | [diff] [blame] | 41 | ADD https://github.com/MiniZinc/MiniZincIDE/releases/download/2.4.2/MiniZincIDE-2.4.2-bundle-linux-x86_64.tgz /minizinc.tgz |
| 42 | |
| 43 | RUN tar -zxf /minizinc.tgz && \ |
| 44 | mv /MiniZincIDE-2.4.2-bundle-linux /minizinc |
| 45 | |
| 46 | RUN mkdir /entry_data \ |
| 47 | && mkdir /entry_data/mzn-lib \ |
| 48 | && ln -s /entry_data/mzn-lib /minizinc/share/minizinc/exec |
| 49 | |
| 50 | RUN mkdir /placement |
| 51 | |
| magnussonl | 2ec0808 | 2020-05-01 10:43:30 +0200 | [diff] [blame] | 52 | ENV OSMPLA_MESSAGE_DRIVER kafka |
| 53 | ENV OSMPLA_MESSAGE_HOST kafka |
| 54 | ENV OSMPLA_MESSAGE_PORT 9092 |
| 55 | |
| 56 | ENV OSMPLA_DATABASE_DRIVER mongo |
| 57 | ENV OSMPLA_DATABASE_URI mongodb://mongo:27017 |
| 58 | |
| 59 | ENV OSMPLA_SQL_DATABASE_URI sqlite:///pla_sqlite.db |
| 60 | |
| 61 | ENV OSMPLA_GLOBAL_LOG_LEVEL INFO |
| 62 | |
| 63 | ENV FZNEXEC "/entry_data/fzn-exec" |
| 64 | ENV PATH "/minizinc/bin:${PATH}" |
| 65 | ENV LD_LIBRARY_PATH "/minizinc/lib:${LD_LIBRARY_PATH}" |
| 66 | |
| 67 | # No healtcheck yet... |
| 68 | #HEALTHCHECK --start-period=120s --interval=10s --timeout=5s --retries=5 \ |
| 69 | # CMD osm-pla-healthcheck || exit 1 |
| 70 | |
| 71 | CMD /bin/bash scripts/start.sh |