Build and publish container / build (pull_request) Canceled after 14m59s
The deployment target is a container on TrueNAS Scale, so the flake sat on no path between the source and the NAS. It was carried over from a sibling project where the flake is the deployment mechanism; here it only added a second build path and a second dependency pin. Worse, it tested the wrong thing: `nix flake check` ran the suite against nixpkgs' ffmpeg while the shipped artefact contains Debian's, and encoder and muxer behaviour is exactly what these tests cover. The Dockerfile gains a `test` stage that installs pytest and runs the suite against the image's own ffmpeg; a failing test fails the build. CI runs `docker build --target test` in place of the host-based Python setup, and the push build states `target: runtime` so the published image is the lean stage rather than the last one in the file. The runtime image carries neither the tests nor pytest. The release step now calls python3 rather than python, since setup-python is no longer in the job to provide the alias. Removes package.nix, flake.nix and flake.lock. A dev shell is a `nix shell` away for anyone who wants one, and the README says so. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
29 lines
930 B
Docker
29 lines
930 B
Docker
FROM python:3.13-slim AS runtime
|
|
|
|
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 ./
|
|
RUN pip install --no-cache-dir . \
|
|
&& rm -rf build music_mirror.egg-info
|
|
|
|
# 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"]
|
|
|
|
# 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
|