Files
swingmusic-extended/Dockerfile
T
Tomas Dvorak 523ebf1c94 fix
2026-04-04 14:39:47 +02:00

47 lines
1.2 KiB
Docker

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 \
&& apt-get install -y --no-install-recommends \
build-essential \
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 src/ ./src/
# Install the package and its dependencies (includes aiohttp, aiofiles, redis)
RUN pip install --no-cache-dir .
# 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"]