forked from MaartenSanders/ycast-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
77 lines (71 loc) · 2.72 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#
# Docker Buildfile for the ycast-docker container based on alpine linux - about 41.4MB
# put dockerfile and bootstrap.sh in same directory and build or enter
# docker build https://github.com/MaartenSanders/ycast-docker.git
#
FROM alpine:latest
#
# Variables
# YC_VERSION version of ycast software
# YC_STATIONS path an name of the indiviudual stations.yml e.g. /ycast/stations/stations.yml
# YC_DEBUG turn ON or OFF debug output of ycast server else only start /bin/sh
# YC_PORT port ycast server listens to, e.g. 80
#
ENV YC_VERSION master
ENV YC_STATIONS /opt/ycast/stations.yml
ENV YC_DEBUG OFF
ENV YC_PORT 80
#
# Upgrade alpine Linux, install python3 and dependencies for pillow - alpine does not use glibc
# pip install needed modules for ycast
# make /opt/ycast Directory, delete unneeded packages, jpeg-dev still needed
# download ycast tar.gz and extract it in ycast Directory
# delete unneeded stuff
#
RUN apk --no-cache update && \
apk --no-cache upgrade && \
apk add --no-cache python3 && \
apk add --no-cache py3-pip && \
apk add --no-cache zlib-dev && \
apk add --no-cache jpeg-dev && \
apk add --no-cache build-base && \
apk add --no-cache python3-dev && \
pip3 install --no-cache-dir requests --break-system-packages && \
pip3 install --no-cache-dir flask --break-system-packages && \
pip3 install --no-cache-dir PyYAML --break-system-packages && \
pip3 install --no-cache-dir Pillow --break-system-packages && \
pip3 install --no-cache-dir olefile --break-system-packages && \
mkdir /opt/ycast && \
apk del --no-cache python3-dev && \
apk del --no-cache build-base && \
apk del --no-cache zlib-dev && \
apk add --no-cache curl && \
# curl -L https://github.com/milaq/YCast/archive/$YC_VERSION.tar.gz \
curl -L https://github.com/milaq/YCast/archive/${YC_VERSION}.tar.gz \
# curl -L https://github.com/milaq/YCast/archive/master.tar.gz \
# curl -L https://github.com/milaq/YCast.git \
# curl -L https://codeload.github.com/MaartenSanders/YCast/tar.gz/$YC_VERSION \
| tar xvzC /opt/ycast && \
apk del --no-cache curl && \
pip3 uninstall --no-cache-dir -y setuptools --break-system-packages && \
# pip3 uninstall --no-cache-dir -y pip && \
find /usr/lib -name \*.pyc -exec rm -f {} \; && \
# find /usr/share/terminfo -type f -not -name xterm -exec rm -f {} \; && \
find /usr/lib -type f -name \*.exe -exec rm -f {} \;
#
# Set Workdirectory on ycast folder
#
WORKDIR /opt/ycast/YCast-${YC_VERSION}
#
# Copy bootstrap.sh to /opt
#
COPY bootstrap.sh /opt
#
# Docker Container should be listening for AVR on port 80
#
EXPOSE ${YC_PORT}/tcp
#
# Start bootstrap on Container start
#
RUN ["chmod", "+x", "/opt/bootstrap.sh"]
ENTRYPOINT ["/opt/bootstrap.sh"]