2026-08-21 15:06:06 +01:00
|
|
|
FROM python:3.13-slim AS runtime
|
2026-08-21 14:32:28 +01:00
|
|
|
|
|
|
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
|
|
|
|
|
|
# ffmpeg does the encoding; the application itself has no Python dependencies.
|
|
|
|
|
RUN apt-get update \
|
|
|
|
|
&& apt-get install --no-install-recommends -y ffmpeg \
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
COPY pyproject.toml README.md ./
|
|
|
|
|
COPY music_mirror.py ./
|
2026-08-21 15:06:06 +01:00
|
|
|
RUN pip install --no-cache-dir . \
|
|
|
|
|
&& rm -rf build music_mirror.egg-info
|
2026-08-21 14:32:28 +01:00
|
|
|
|
|
|
|
|
# Runs as root by default so a bind-mounted dataset of any ownership is
|
|
|
|
|
# writable. Override with `user:` in compose to run as the dataset's owner.
|
|
|
|
|
ENTRYPOINT ["music-mirror"]
|
2026-08-21 15:06:06 +01:00
|
|
|
|
|
|
|
|
# Test stage: the suite runs against this image's own ffmpeg, which is the one
|
|
|
|
|
# that ships. Build it with `--target test`; a failing test fails the build.
|
|
|
|
|
# The published image is the `runtime` stage above and carries none of this.
|
|
|
|
|
FROM runtime AS test
|
|
|
|
|
|
|
|
|
|
RUN pip install --no-cache-dir pytest
|
|
|
|
|
COPY pytest.ini ./
|
|
|
|
|
COPY tests ./tests
|
|
|
|
|
RUN python -m pytest
|