-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathDockerfile
executable file
·63 lines (54 loc) · 1.51 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
FROM python:alpine as build-stage
# Official Python base image is needed or some applications will segfault.
# PyInstaller needs zlib-dev, gcc, libc-dev, and musl-dev
RUN apk --update --no-cache add \
zlib-dev \
musl-dev \
libc-dev \
gcc \
g++ \
git \
make \
cmake \
upx && \
pip install --upgrade pip
ADD requirements.txt /tmp/requirements.txt
ADD src/ /tmp/app/
RUN pip install pyinstaller && \
pip install -r /tmp/requirements.txt && \
cd /tmp/app/ && \
pyinstaller \
-n chips \
--onefile main.py \
--python-option u \
--hidden-import config.py \
--hidden-import stbmock.py \
--hidden-import storage.py \
--hidden-import utils.py
ADD config_template /tmp/app/dist/config.template
ADD docker-entrypoint.sh /tmp/app/dist/docker-entrypoint.sh
RUN chmod +x -R /tmp/app/dist
FROM alpine:latest
LABEL maintainer="VergilGao"
LABEL org.opencontainers.image.source="https://github.com/VergilGao/Telecom-IPTV-Mock"
ENV TZ="Asia/Shanghai"
ENV UID=99
ENV GID=100
ENV UMASK=002
ENV CRONTAB="0 5 * * *"
RUN apk add --no-cache --update \
tzdata \
coreutils \
shadow \
cronie \
su-exec && \
rm -rf /var/cache/apk/* && \
mkdir -p /app && \
mkdir -p /data && \
mkdir -p /config && \
useradd -d /config -s /bin/sh abc && \
chown -R abc /config && \
chown -R abc /data
COPY --from=build-stage /tmp/app/dist/ /app/
VOLUME [ "/data", "/config" ]
ENTRYPOINT ["/app/docker-entrypoint.sh"]