FROM alpine:edge as base RUN ["apk", "add", "--no-cache", "py3-virtualenv"] RUN ["mkdir", "-p", "/app/version"] 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 ["backend/stream_providers.py", "/app/stream_providers.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"] 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=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/start.sh"]