This commit is contained in:
Tomas Dvorak
2026-04-02 10:16:30 +02:00
parent 0cabd3bf1c
commit ab01f915c3
15 changed files with 325 additions and 21 deletions
+31 -9
View File
@@ -1,26 +1,48 @@
FROM python:3.11-slim
FROM node:20-bookworm-slim AS webclient-builder
WORKDIR /webclient
COPY swingmusic-webclient/package.json swingmusic-webclient/package-lock.json ./
RUN npm ci
COPY swingmusic-webclient/ ./
RUN npm run build
FROM python:3.11-slim AS runtime
WORKDIR /app
LABEL "author"="swing music"
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
SWINGMUSIC_CLIENT_DIR=/app/client
EXPOSE 1970/tcp
VOLUME /music
VOLUME /config
RUN apt-get update
RUN apt-get install -y gcc libev-dev
RUN apt-get install -y ffmpeg libavcodec-extra
RUN apt-get install -y redis-tools # For DragonflyDB/Redis connectivity
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
gcc \
libev-dev \
ffmpeg \
libavcodec-extra \
redis-tools \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Copy repo root files needed for installation
COPY pyproject.toml requirements.txt version.txt ./
COPY pyproject.toml requirements.txt version.txt ./
COPY src/ ./src/
# Install the package and its dependencies
RUN pip install --no-cache-dir .
# Install Redis library for DragonflyDB support
RUN pip install redis
RUN pip install --no-cache-dir redis
# Ship a deterministic web client with the backend image so startup does not
# depend on downloading release assets at runtime.
COPY --from=webclient-builder /webclient/dist /app/client
ENTRYPOINT ["python", "-m", "swingmusic", "--host", "0.0.0.0", "--config", "/config"]