forked from marcopovitch/sl2influxdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
46 lines (37 loc) · 1.03 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
40
41
42
43
44
45
46
FROM debian:9-slim
LABEL maintainer="Marc Grunberg <[email protected]>"
ENV SL2INFLUXDB_DIR /opt/sl2influxdb
COPY sl2influxdb $SL2INFLUXDB_DIR/sl2influxdb
COPY setup.py $SL2INFLUXDB_DIR/
COPY requirements.txt $SL2INFLUXDB_DIR/
WORKDIR $SL2INFLUXDB_DIR
RUN set -ex \
&& buildDeps=' \
g++ \
python3-dev \
' \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
python3 \
python3-pip \
python3-setuptools \
$buildDeps \
## Install numpy before obspy…
&& pip3 install --no-cache-dir numpy \
&& pip3 install --no-cache-dir --upgrade -r requirements.txt \
&& pip3 install . \
&& apt-get purge -y --autoremove $buildDeps \
&& apt-get clean \
&& rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/* \
$SL2INFLUXDB_DIR
COPY run.sh /run.sh
RUN set -ex \
&& chmod +x /run.sh \
&& useradd -ms /bin/bash sysop \
&& mkdir /data \
&& chown sysop:users /data
USER sysop
ENTRYPOINT ["/run.sh"]