From ea3571ae422bbb1ad24762e13572924b0eea8d45 Mon Sep 17 00:00:00 2001 From: xiliourt Date: Sat, 26 Jul 2025 09:12:13 +1000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=AC=20Added=20actual=20ghcr.io=20URL?= =?UTF-8?q?=20for=20docker=20commands=20(#139)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added actual ghcr.io URL for docker commands Added ghcr.io/oskvr37/tiddl:latest in docker-compose.yml example code and docker run example code, in README.md * Update Dockerfile --- Dockerfile | 18 ++++++++++++++++-- README.md | 4 ++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index b9e19f3..81ddac9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,20 @@ +# --- Optimised Layer Caching --- # +# Layer 1 (ffmpeg) will never regenerate +# Layer 2 (pip install) will regenerate if pyproject.toml is changed +# Layer 3 (build & install tiddl), rengerates on any code change + FROM python:alpine WORKDIR /root + +# -- Layer 1 - ffmpeg install (it'll stay cached as a layer always) -- +RUN apk add --no-cache ffmpeg + +# -- Layer 2 - pip install depenencies (remains cached unless pyproject.toml changes) -- +# Exports 'depenencies' from pyproject.toml formatted to requirements.txt format, pipelined to pip install +COPY pyproject.toml . +RUN python -c "import tomllib; f=open('pyproject.toml','rb'); print('\n'.join(tomllib.load(f)['project']['dependencies']))" | xargs pip install + +# -- Layer 3 - Uncached layer (regenerates anytime a new build is released) -- COPY . . -RUN --mount=type=cache,target=/root/.cache/pip pip install . +RUN pip install --no-deps . RUN rm -rf * -RUN apk add ffmpeg diff --git a/README.md b/README.md index c57cb9d..4c8b732 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Commands: Based on python:alpine, slim build **Docker run example (quickest / easiest)** ``` -docker run -rm -v /downloads/dir:/root/Music/Tiddl/ -v ./config/tiddl/:/root/ > +docker run -rm -v /downloads/dir:/root/Music/Tiddl/ -v ./config/tiddl/:/root/ ghcr.io/oskvr37/tiddl:latest ``` **docker-compose.yml example (not required, though allows for advanced configs)** @@ -58,7 +58,7 @@ docker run -rm -v /downloads/dir:/root/Music/Tiddl/ -v ./config/tiddl/:/root/ > services: tiddl: container_name: tiddl - image: :latest + image: ghcr.io/oskvr37/tiddl:latest volumes: - /downloads/dir:/root/Music/Tiddl/ #default dir - ./config/tiddl/:/root/ # Default location of config file