use pip for python dependencies

This commit is contained in:
2021-05-19 10:40:18 +02:00
parent 4504dc7c6d
commit 5dd5390fac
5 changed files with 29 additions and 12 deletions

View File

@ -1,20 +1,30 @@
FROM alpine:edge as base
RUN ["apk", "add", "--no-cache", "--repository", "https://dl-cdn.alpinelinux.org/alpine/edge/testing", "streamlink", "py3-tornado", "py3-aiohttp", "py3-aiohttp-socks"]
RUN ["mkdir", "/app"]
COPY ["stream.py", "/app/stream.py"]
COPY ["sources.py", "/app/sources.py"]
RUN ["apk", "add", "--no-cache", "py3-virtualenv"]
RUN ["mkdir", "-p", "/app"]
COPY ["tv.json", "/app/setup/tv.json"]
COPY ["backend/start.sh", "/app/start.sh"]
COPY ["backend/install.sh", "/app/setup/install.sh"]
COPY ["backend/sources.py", "/app/setup/sources.py"]
COPY ["backend/stream.py", "/app/stream.py"]
COPY ["frontend/index.html", "/app/index.html"]
COPY ["frontend/script.js", "/app/script.js"]
COPY ["frontend/style.css", "/app/style.css"]
RUN ["chmod", "-R", "755", "/app"]
COPY ["tv.json", "/app/tv.json"]
RUN ["python3", "/app/sources.py"]
RUN ["rm", "/app/tv.json"]
RUN ["rm", "/app/sources.py"]
FROM base as sources
RUN ["apk", "add", "--no-cache", "py3-requests"]
RUN ["python3", "/app/setup/sources.py"]
RUN ["rm", "-r", "/app/setup"]
FROM base as venv
RUN ["apk", "add", "--no-cache", "musl-dev", "build-base", "python3-dev"]
RUN ["/app/setup/install.sh"]
RUN ["rm", "-r", "/app/setup"]
FROM scratch
COPY --from=base / /
COPY --from=sources / /
COPY --from=venv /app/venv /app/venv
USER 1444:1444
ENV ICECAST_SERVER=https://icecast.purser.it:7000
ENV STREAM_SERVER=https://stream.purser.it
ENTRYPOINT ["/app/stream.py"]
ENTRYPOINT ["/app/start.sh"]