refactor docker build
This commit is contained in:
parent
091ec59265
commit
b4d7b81a66
17
Dockerfile
17
Dockerfile
@ -1,9 +1,7 @@
|
||||
FROM alpine:edge as base
|
||||
RUN ["apk", "add", "--no-cache", "py3-virtualenv"]
|
||||
FROM roypur/stream-runtime:latest as base
|
||||
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"]
|
||||
@ -11,20 +9,11 @@ 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 ["/app/venv/bin/python3", "/app/setup/sources.py"]
|
||||
RUN ["rm", "-r", "/app/setup"]
|
||||
|
||||
FROM scratch
|
||||
COPY --from=sources / /
|
||||
COPY --from=venv /app/venv /app/venv
|
||||
COPY --from=base / /
|
||||
USER 1444:1444
|
||||
ENV ICECAST_SERVER=https://icecast.purser.it:7000
|
||||
ENV STREAM_SERVER=https://stream.purser.it
|
||||
|
@ -2,14 +2,13 @@
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">{% for item in meta %}
|
||||
{% block item %}<meta property="{{ item[0] }}" content="{{ item[1] }}" />{% end %}{% end %}
|
||||
<script async src="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"></script>
|
||||
<script async src="https://www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js"></script>
|
||||
<script async src="{{ data["script"] }}"></script>
|
||||
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/video.js/{{ data["videojs_version"] }}/video.min.js"></script>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/@silvermine/videojs-chromecast@{{ data["chromecast_version"] }}/dist/silvermine-videojs-chromecast.min.js"></script>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/{{ data["font_awesome_version"] }}/css/all.min.css">
|
||||
<script defer src="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"></script>
|
||||
<script defer src="https://www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js"></script>
|
||||
<script defer src="{{ data["script"] }}"></script>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/video.js/{{ data["videojs_version"] }}/video-js.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@silvermine/videojs-chromecast@{{ data["chromecast_version"] }}/dist/silvermine-videojs-chromecast.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/{{ data["font_awesome_version"] }}/css/all.min.css">
|
||||
<link rel="stylesheet" href="{{ data["custom_style"] }}">
|
||||
</head>
|
||||
<body>
|
||||
|
@ -35,6 +35,7 @@
|
||||
options.techOrder = ["chromecast", "html5"];
|
||||
options.plugins = {};
|
||||
options.plugins.chromecast = {};
|
||||
options.plugins.chromecast.addButtonToControlBar = false;
|
||||
const player = videojs(video, options);
|
||||
const source = {};
|
||||
source.type = ctype;
|
||||
@ -45,18 +46,29 @@
|
||||
cbutton.clickHandler = (ev) => {
|
||||
player.trigger("chromecastRequested");
|
||||
}
|
||||
const button = new Button(player, cbutton);
|
||||
button.addClass("fab");
|
||||
button.addClass("fa-chromecast");
|
||||
button.addClass("vjs-control");
|
||||
button.addClass("vjs-button");
|
||||
button.addClass("vjs-big-chromecast");
|
||||
cbutton.text = "Chromecast";
|
||||
|
||||
const bigCastButton = new Button(player, cbutton);
|
||||
bigCastButton.addClass("fab");
|
||||
bigCastButton.addClass("fa-chromecast");
|
||||
bigCastButton.addClass("vjs-control");
|
||||
bigCastButton.addClass("vjs-button");
|
||||
bigCastButton.addClass("vjs-big-chromecast");
|
||||
player.addChild(bigCastButton);
|
||||
|
||||
const smallCastButton = new Button(player, cbutton);
|
||||
smallCastButton.addClass("fab");
|
||||
smallCastButton.addClass("fa-chromecast");
|
||||
smallCastButton.addClass("vjs-control");
|
||||
smallCastButton.addClass("vjs-button");
|
||||
player.controlBar.addChild(smallCastButton);
|
||||
|
||||
player.addChild(button);
|
||||
player.one("play", () => {
|
||||
player.removeChild(button);
|
||||
player.removeChild(bigCastButton);
|
||||
});
|
||||
|
||||
player.on("chromecastConnected", () => {
|
||||
console.log(player.chromecastSessionManager.remotePlayer.volumeLevel);
|
||||
if(player.volume() > 0.3) {
|
||||
player.volume(0.2);
|
||||
}
|
||||
|
@ -1,6 +1,9 @@
|
||||
body {
|
||||
margin: 0px;
|
||||
}
|
||||
.fa-chromecast:before {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
.vjs-big-chromecast {
|
||||
position: absolute !important;
|
||||
font-size: 3rem !important;
|
||||
|
Loading…
Reference in New Issue
Block a user