Skip to content

Commit 37734e4

Browse files
committed
Add dockerfile
1 parent 8a16bb0 commit 37734e4

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed

Dockerfile

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
FROM ubuntu:20.04
2+
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
5+
# -------------------------------
6+
# System dependencies
7+
# -------------------------------
8+
RUN apt update && \
9+
apt install -y \
10+
software-properties-common \
11+
build-essential \
12+
git \
13+
python3-dev \
14+
python3-pip \
15+
python3-setuptools \
16+
python3-wheel \
17+
gettext \
18+
postgresql \
19+
libpq-dev \
20+
graphviz \
21+
&& apt clean \
22+
&& rm -rf /var/lib/apt/lists/*
23+
24+
# Needed for some Python packages on Ubuntu 20
25+
RUN pip3 install --upgrade pip && \
26+
pip3 install "setuptools<66.0.0"
27+
28+
# -------------------------------
29+
# Python dependencies
30+
# -------------------------------
31+
RUN pip3 install \
32+
requests \
33+
ujson \
34+
django==4.2 \
35+
pluggy \
36+
py \
37+
attrs \
38+
six \
39+
more-itertools \
40+
ply \
41+
pytest \
42+
atomicwrites \
43+
pycparser \
44+
psycopg2-binary \
45+
sympy \
46+
pytz
47+
48+
# -------------------------------
49+
# Create working directory
50+
# -------------------------------
51+
RUN git clone https://github.com/ispras/cv-visualizer.git /cvv
52+
WORKDIR /cvv
53+
RUN deploys/deployment.sh cvdb
54+
55+
# -------------------------------
56+
# Expose default CVV port
57+
# -------------------------------
58+
EXPOSE 8989
59+
60+
# -------------------------------
61+
# Create an entrypoint
62+
# -------------------------------
63+
COPY deploys/entrypoint.sh /cvv/entrypoint.sh
64+
RUN chmod +x /cvv/entrypoint.sh
65+
66+
ENTRYPOINT ["/cvv/entrypoint.sh"]
67+

deploys/entrypoint.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Start PostgreSQL
5+
echo "Starting PostgreSQL..."
6+
max=5
7+
for i in $(seq 1 $max); do
8+
echo "Starting PostgreSQL (attempt $i/$max)..."
9+
service postgresql restart && break
10+
echo "Postgres failed to start, retrying..."
11+
sleep 3
12+
done
13+
14+
# Start CVV Web UI
15+
echo "[CVV] Starting CVV Web Interface..."
16+
cd /cvv
17+
./start.sh --host 0.0.0.0 --port 8989
18+

0 commit comments

Comments
 (0)