1
0
mirror of https://github.com/hanxi/xiaomusic.git synced 2025-12-15 16:18:14 +08:00

build: 基础镜像修改

This commit is contained in:
涵曦
2024-12-15 02:07:48 +08:00
parent 499728df0b
commit 1d8732d3da
2 changed files with 19 additions and 2 deletions

View File

@@ -11,10 +11,15 @@ RUN pdm install --prod --no-editable
FROM hanxi/xiaomusic:runtime FROM hanxi/xiaomusic:runtime
WORKDIR /app WORKDIR /app
COPY --from=builder /app/.venv /app/.venv COPY --from=builder /app/.venv ./.venv
COPY --from=builder /app/xiaomusic/ ./xiaomusic/ COPY --from=builder /app/xiaomusic/ ./xiaomusic/
COPY --from=builder /app/plugins/ ./plugins/ COPY --from=builder /app/plugins/ ./plugins/
COPY --from=builder /app/xiaomusic.py . COPY --from=builder /app/xiaomusic.py .
RUN touch /app/.dockerenv
RUN mkdir -p /etc/supervisor/conf.d
COPY supervisor.conf /etc/supervisor/conf.d/supervisor.conf
ENV XIAOMUSIC_HOSTNAME=192.168.2.5 ENV XIAOMUSIC_HOSTNAME=192.168.2.5
ENV XIAOMUSIC_PORT=8090 ENV XIAOMUSIC_PORT=8090
VOLUME /app/conf VOLUME /app/conf
@@ -22,4 +27,5 @@ VOLUME /app/music
EXPOSE 8090 EXPOSE 8090
ENV TZ=Asia/Shanghai ENV TZ=Asia/Shanghai
ENV PATH=/app/.venv/bin:$PATH ENV PATH=/app/.venv/bin:$PATH
ENTRYPOINT [".venv/bin/python3","xiaomusic.py"]
CMD ["/usr/bin/supervisord", "-n"]

11
supervisor.conf Normal file
View File

@@ -0,0 +1,11 @@
[supervisord]
nodaemon=true # 确保 supervisord 在前台运行,以便 Docker 容器不会退出
[program:xiaomusic]
command=/app/.venv/bin/python3 /app/xiaomusic.py
directory=/app
autostart=true
autorestart=true
stderr_logfile=/var/log/xiaomusic.err.log
stdout_logfile=/var/log/xiaomusic.out.log