forked from faucetsdn/poseidon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (35 loc) · 1.12 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
FROM alpine:3.10
LABEL maintainer="Charlie Lewis <[email protected]>"
LABEL poseidon.namespace="primary"
ENV PYTHONUNBUFFERED 1
COPY requirements.txt requirements.txt
COPY healthcheck /healthcheck
RUN apk upgrade --no-cache && \
apk add --no-cache \
build-base \
curl \
python3 \
python3-dev \
py3-paramiko \
tini \
yaml-dev \
linux-headers && \
pip3 install --no-cache-dir --upgrade pip==20.0.2 && \
pip3 install --no-cache-dir -r requirements.txt && \
pip3 install --no-cache-dir -r /healthcheck/requirements.txt && \
apk del build-base \
python3-dev \
yaml-dev && \
rm -rf /var/cache/* && \
rm -rf /root/.cache/*
# healthcheck
ENV FLASK_APP /healthcheck/hc.py
HEALTHCHECK --interval=15s --timeout=15s \
CMD curl --silent --fail http://localhost:5000/healthcheck || exit 1
COPY . /poseidon
WORKDIR /poseidon
ENV PYTHONPATH /poseidon:$PYTHONPATH
RUN mkdir -p /opt/poseidon
RUN mv /poseidon/config/poseidon.config /opt/poseidon/poseidon.config
ENV POSEIDON_CONFIG /opt/poseidon/poseidon.config
CMD (flask run > /dev/null 2>&1) & (tini -s -- /usr/bin/python3 poseidon/main.py)