From 640c75e499172056523e7c6064c15ea8f11a6099 Mon Sep 17 00:00:00 2001 From: krek0 Date: Sun, 3 May 2026 23:36:34 +0200 Subject: [PATCH 1/2] Fix image display in Docker by loading initial fixtures on startup --- Dockerfile | 2 +- entrypoint.sh | 1 + photo21/settings.py | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d45d054..8e47172 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ RUN apt-get update && apt-get install -y gettext && rm -rf /var/lib/apt/lists/* COPY . . -RUN python manage.py compilemessages +RUN SECRET_KEY=dummy python manage.py compilemessages # Create volume mount points RUN mkdir -p /app/media /app/static /app/data diff --git a/entrypoint.sh b/entrypoint.sh index fca4a2c..8638676 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -3,5 +3,6 @@ set -e python manage.py collectstatic --noinput python manage.py migrate --noinput +python manage.py loaddata initial python manage.py create_default_admin exec gunicorn photo21.wsgi:application --bind 0.0.0.0:8000 --workers 3 diff --git a/photo21/settings.py b/photo21/settings.py index 222d7fa..953a8c2 100644 --- a/photo21/settings.py +++ b/photo21/settings.py @@ -235,7 +235,6 @@ WHITENOISE_MANIFEST_STRICT = False LOCALE_PATHS = [os.path.join(BASE_DIR, "photo21/locale")] -FIXTURE_DIRS = [os.path.join(BASE_DIR, "photo21/fixtures")] # Do not send email during debug # By default Django sends mails to localhost:25 without authentification From 7319a738f4abbd53f003eeb2d2f99e79c02c94e8 Mon Sep 17 00:00:00 2001 From: krek0 Date: Sun, 3 May 2026 23:50:48 +0200 Subject: [PATCH 2/2] Push latest tag on docker image on release --- .forgejo/workflows/docker.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.forgejo/workflows/docker.yml b/.forgejo/workflows/docker.yml index 90f3a7c..e5da6fc 100644 --- a/.forgejo/workflows/docker.yml +++ b/.forgejo/workflows/docker.yml @@ -22,11 +22,12 @@ jobs: username: ${{ secrets.REGISTRY_USER }} password: ${{ secrets.REGISTRY_TOKEN }} - - name: Build image - run: | - docker build -t git.sinfonie.org/sinfonie/photo26:${{ steps.meta.outputs.TAG }} . - - - name: Push image + - name: Build and push image run: | + docker build \ + -t git.sinfonie.org/sinfonie/photo26:${{ steps.meta.outputs.TAG }} \ + -t git.sinfonie.org/sinfonie/photo26:latest \ + . docker push git.sinfonie.org/sinfonie/photo26:${{ steps.meta.outputs.TAG }} + docker push git.sinfonie.org/sinfonie/photo26:latest