Add files via upload

This commit is contained in:
MaartenSanders 2020-08-12 00:18:27 +02:00 committed by GitHub
commit dcb20f43c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 96 additions and 0 deletions

24
bootstrap.sh Normal file
View File

@ -0,0 +1,24 @@
#!/bin/sh
#Bootstrap File für ycast docker container
#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
if [ "$YC_DEBUG" = "OFF" ]; then
/usr/bin/python3 -m ycast -c $YC_STATIONS -p $YC_PORT
elif [ "$YC_DEBUG" = "ON" ]; then
/usr/bin/python3 -m ycast -c $YC_STATIONS -p $YC_PORT -d
else
/bin/sh
fi

BIN
ycast-docker-v9.tar.gz Normal file

Binary file not shown.

72
ycast-dockerfile-v10 Normal file
View File

@ -0,0 +1,72 @@
#
# Docker Buildfile for the ycast-docker container based on alpine linux - about 41.4MB
# put dockerfile and bootstrap.sh in same directory
# usage: docker build --compress -f ycast-dockerfile-v9 -t yourrepro/ycast-docker:v9 .
#
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 1.0.0
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 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 && \
pip3 install --no-cache-dir flask && \
pip3 install --no-cache-dir PyYAML && \
pip3 install --no-cache-dir Pillow && \
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 \
| tar xvzC /opt/ycast && \
apk del --no-cache curl && \
pip3 uninstall --no-cache-dir -y setuptools && \
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"]