mirror of
https://github.com/azlux/botamusique
synced 2024-11-23 22:06:09 +00:00
Compare commits
No commits in common. "c590ab8eb1930e2e527a3dff5a1ac15716837a18" and "6e5e21ba528f20e6d439577d499359ccfdf4ef2d" have entirely different histories.
c590ab8eb1
...
6e5e21ba52
@ -21,7 +21,7 @@ steps:
|
|||||||
image: python:3
|
image: python:3
|
||||||
commands:
|
commands:
|
||||||
- pip3 install jinja2
|
- pip3 install jinja2
|
||||||
- ./scripts/translate_templates.py --lang-dir lang/ --template-dir web/templates/
|
- ./scripts/translate_templates.py --lang-dir lang/ --template-dir templates/
|
||||||
when:
|
when:
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
@ -101,7 +101,7 @@ steps:
|
|||||||
image: python:3
|
image: python:3
|
||||||
commands:
|
commands:
|
||||||
- pip3 install jinja2
|
- pip3 install jinja2
|
||||||
- ./scripts/translate_templates.py --lang-dir lang/ --template-dir web/templates/
|
- ./scripts/translate_templates.py --lang-dir lang/ --template-dir templates/
|
||||||
when:
|
when:
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
@ -122,7 +122,7 @@ steps:
|
|||||||
privileged: true
|
privileged: true
|
||||||
settings:
|
settings:
|
||||||
repo: azlux/botamusique
|
repo: azlux/botamusique
|
||||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
|
||||||
username:
|
username:
|
||||||
from_secret: docker_username
|
from_secret: docker_username
|
||||||
password:
|
password:
|
||||||
@ -147,7 +147,7 @@ steps:
|
|||||||
privileged: true
|
privileged: true
|
||||||
settings:
|
settings:
|
||||||
repo: azlux/botamusique
|
repo: azlux/botamusique
|
||||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
|
||||||
username:
|
username:
|
||||||
from_secret: docker_username
|
from_secret: docker_username
|
||||||
password:
|
password:
|
||||||
|
19
Dockerfile
19
Dockerfile
@ -1,4 +1,3 @@
|
|||||||
ARG ARCH=
|
|
||||||
FROM python:3-slim-bullseye AS python-builder
|
FROM python:3-slim-bullseye AS python-builder
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
WORKDIR /botamusique
|
WORKDIR /botamusique
|
||||||
@ -7,31 +6,19 @@ RUN apt-get update \
|
|||||||
&& apt-get install --no-install-recommends -y gcc g++ ffmpeg libjpeg-dev libmagic-dev opus-tools zlib1g-dev \
|
&& apt-get install --no-install-recommends -y gcc g++ ffmpeg libjpeg-dev libmagic-dev opus-tools zlib1g-dev \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
COPY . /botamusique
|
COPY . /botamusique
|
||||||
|
|
||||||
RUN python3 -m venv venv \
|
RUN python3 -m venv venv \
|
||||||
&& venv/bin/pip install wheel \
|
&& venv/bin/pip install wheel \
|
||||||
&& venv/bin/pip install -r requirements.txt
|
&& venv/bin/pip install -r requirements.txt
|
||||||
|
|
||||||
FROM ${ARCH}node:14-bullseye-slim AS node-builder
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
|
||||||
WORKDIR /botamusique/web
|
|
||||||
COPY --from=python-builder /botamusique /botamusique
|
|
||||||
RUN npm install
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
FROM ${ARCH}python:3-slim-bullseye AS template-builder
|
FROM python:3-slim-bullseye
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
|
||||||
WORKDIR /botamusique
|
|
||||||
COPY --from=node-builder /botamusique /botamusique
|
|
||||||
RUN venv/bin/python scripts/translate_templates.py --lang-dir /botamusique/lang --template-dir /botamusique/web/templates
|
|
||||||
|
|
||||||
|
|
||||||
FROM python:3.11-slim-bullseye
|
|
||||||
ENV DEBIAN_FRONTEND noninteractive
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
EXPOSE 8181
|
EXPOSE 8181
|
||||||
RUN apt update && \
|
RUN apt update && \
|
||||||
apt install --no-install-recommends -y opus-tools ffmpeg libmagic-dev curl tar && \
|
apt install --no-install-recommends -y opus-tools ffmpeg libmagic-dev curl tar && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
COPY --from=template-builder /botamusique /botamusique
|
COPY --from=python-builder /botamusique /botamusique
|
||||||
WORKDIR /botamusique
|
WORKDIR /botamusique
|
||||||
RUN chmod +x entrypoint.sh
|
RUN chmod +x entrypoint.sh
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ ENV DEBIAN_FRONTEND=noninteractive
|
|||||||
WORKDIR /botamusique
|
WORKDIR /botamusique
|
||||||
COPY --from=python-builder /botamusique .
|
COPY --from=python-builder /botamusique .
|
||||||
COPY --from=node-builder /botamusique/templates templates
|
COPY --from=node-builder /botamusique/templates templates
|
||||||
RUN venv/bin/python scripts/translate_templates.py --lang-dir /botamusique/lang --template-dir /botamusique/web/templates
|
RUN venv/bin/python scripts/translate_templates.py --lang-dir /botamusique/lang --template-dir /botamusique/templates
|
||||||
|
|
||||||
|
|
||||||
FROM ${ARCH}python:3-slim-bullseye
|
FROM ${ARCH}python:3-slim-bullseye
|
||||||
|
@ -96,7 +96,7 @@ python3 -m venv venv
|
|||||||
venv/bin/pip install wheel
|
venv/bin/pip install wheel
|
||||||
venv/bin/pip install -r requirements.txt
|
venv/bin/pip install -r requirements.txt
|
||||||
(cd web && npm install && npm run build)
|
(cd web && npm install && npm run build)
|
||||||
venv/bin/python3 ./scripts/translate_templates.py --lang-dir lang/ --template-dir web/templates/
|
venv/bin/python3 ./scripts/translate_templates.py --lang-dir lang/ --template-dir templates/
|
||||||
```
|
```
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ class ReverseProxied(object):
|
|||||||
|
|
||||||
|
|
||||||
root_dir = os.path.dirname(__file__)
|
root_dir = os.path.dirname(__file__)
|
||||||
web = Flask(__name__, template_folder=os.path.join(root_dir, "web/templates"))
|
web = Flask(__name__, template_folder=os.path.join(root_dir, "templates"))
|
||||||
#web.config['TEMPLATES_AUTO_RELOAD'] = True
|
#web.config['TEMPLATES_AUTO_RELOAD'] = True
|
||||||
log = logging.getLogger("bot")
|
log = logging.getLogger("bot")
|
||||||
user = 'Remote Control'
|
user = 'Remote Control'
|
||||||
@ -227,7 +227,7 @@ def get_all_dirs():
|
|||||||
@web.route("/", methods=['GET'])
|
@web.route("/", methods=['GET'])
|
||||||
@requires_auth
|
@requires_auth
|
||||||
def index():
|
def index():
|
||||||
return open(os.path.join(root_dir, f"web/templates/index.{var.language}.html"), "r").read()
|
return open(os.path.join(root_dir, f"templates/index.{var.language}.html"), "r").read()
|
||||||
|
|
||||||
|
|
||||||
@web.route("/playlist", methods=['GET'])
|
@web.route("/playlist", methods=['GET'])
|
||||||
|
Loading…
Reference in New Issue
Block a user