-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
67 lines (56 loc) · 1.79 KB
/
Dockerfile
File metadata and controls
67 lines (56 loc) · 1.79 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
FROM ghcr.io/cartoway/optimizer-ortools:master
ARG BUNDLE_WITHOUT="test development"
# Install Vroom
ARG VROOM_RELEASE=v1.14.0
RUN apt update -y && \
apt install -y \
git-core \
build-essential \
g++ \
libssl-dev \
libasio-dev \
libglpk-dev \
pkg-config \
netcat-traditional
RUN git clone --recurse-submodules https://github.com/VROOM-Project/vroom.git && \
cd vroom/src && \
git fetch --tags && \
git checkout -q $VROOM_RELEASE && \
make -j$(nproc) && \
cp ../bin/vroom /usr/local/bin && \
cd /
RUN apt update -y && apt install -y \
python3 \
python-is-python3 \
python3-pip \
python3-venv
ARG PYVRP_VERSION=0.13.1
# PYVRP_BRANCH can be: a branch name (e.g. "main"), a tag (e.g. "v0.12.1"), or a commit SHA
# ARG PYVRP_BRANCH=
ARG PYVRP_GIT_URL=https://github.com/PyVRP/PyVRP.git
RUN python -m venv /opt/pyenv && \
/opt/pyenv/bin/pip install --upgrade pip && \
/opt/pyenv/bin/pip install numpy && \
if [ -z "$PYVRP_BRANCH" ]; then \
/opt/pyenv/bin/pip install pyvrp=="$PYVRP_VERSION"; \
else \
/opt/pyenv/bin/pip install git+$PYVRP_GIT_URL@$PYVRP_BRANCH; \
fi
ENV PATH="/opt/pyenv/bin:$PATH"
ENV LANG C.UTF-8
WORKDIR /srv/app
RUN apt update && \
libgeos=$(apt-cache search 'libgeos-' | grep -P 'libgeos-\d.*' | awk '{print $1}') && \
apt install -y git libgeos-dev ${libgeos} libicu-dev libglpk-dev nano
ADD ./Gemfile /srv/app/
ADD ./Gemfile.lock /srv/app/
RUN bundle install --full-index --without ${BUNDLE_WITHOUT}
ADD . /srv/app
EXPOSE 80
HEALTHCHECK \
--start-interval=1s \
--start-period=30s \
--interval=30s \
--timeout=20s \
--retries=5 \
CMD wget --no-verbose --tries=1 -O /dev/null http://127.0.0.1:80/ping || exit 1