-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (33 loc) · 780 Bytes
/
Dockerfile
File metadata and controls
39 lines (33 loc) · 780 Bytes
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 ubuntu:17.04
ENV DEBIAN_FRONTEND=noninteractive \
WORKDIR='/' \
DATADIR='/data' \
EPOINT='/entry-point.sh' \
NAME='userline'
WORKDIR $WORKDIR
RUN apt-get update && \
apt-get -y dist-upgrade && \
apt-get -y install \
gosu \
python3-pip
RUN mkdir /$NAME && \
mkdir -p $DATADIR
ADD src/ /$NAME
ADD requirements.txt /$NAME
RUN cd $NAME && \
pip3 install -U -r requirements.txt
RUN echo "#!/bin/bash\n\
set -e\n\
\n\
if [ \"\$1\" = \"$NAME\" ]\n\
then\n\
shift\n\
chown -R $NAME:$NAME $DATADIR\n\
exec gosu $NAME /$NAME/$NAME.py \"\$@\"\n\
fi\n\
\n\
exec \"\$@\"" > $EPOINT && \
chmod +x $EPOINT && \
useradd -r -s /sbin/nologin -d /$NAME $NAME
WORKDIR $WORKDIR$NAME
ENTRYPOINT ["/entry-point.sh"]