From 0c368df0de2d66617465822528a12f2fe096338c Mon Sep 17 00:00:00 2001 From: eneller Date: Thu, 3 Jul 2025 11:40:04 +0200 Subject: [PATCH] fix: Docker deps, volume mount --- Dockerfile | 2 ++ docker-compose.yml | 4 ++++ src/epub2go_web/settings.py | 7 +------ 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index b4df69d..6860889 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,11 +2,13 @@ FROM python:3.12 VOLUME [ "/app/src/epub2go_web/media" ] EXPOSE 50000/tcp EXPOSE 50000/udp +ENV DJANGO_DEBUG=FALSE COPY --from=ghcr.io/astral-sh/uv:0.7.18 /uv /uvx /bin/ WORKDIR /app # Install dependencies +RUN apt-get update RUN apt-get install -y pandoc RUN --mount=type=cache,target=/root/.cache/uv \ --mount=type=bind,source=uv.lock,target=uv.lock \ diff --git a/docker-compose.yml b/docker-compose.yml index 3b86106..185b177 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,6 +11,8 @@ services: - "50000:50000" env_file: - .env + volumes: + - ./data:/app/src/epub2go_web/media redis: image: redis celery: @@ -20,4 +22,6 @@ services: - app env_file: - .env + volumes: + - ./data:/app/src/epub2go_web/media command: uv run --directory=/app/src celery -A epub2go_web worker --loglevel=INFO diff --git a/src/epub2go_web/settings.py b/src/epub2go_web/settings.py index 350e6b7..660fb9a 100644 --- a/src/epub2go_web/settings.py +++ b/src/epub2go_web/settings.py @@ -15,11 +15,6 @@ import environ import os from pathlib import Path -env = environ.Env( - # set casting, default value - DEBUG=(bool, False) -) - # Build paths inside the project like this: BASE_DIR / 'subdir'. PROJ_DIR = Path(__file__).resolve().parent @@ -33,7 +28,7 @@ BASE_DIR = PROJ_DIR.parent SECRET_KEY = "django-insecure-^@m5bl*8x+=@c^b0lhkgb-%_#9#&oad=v15jq=!0$g#x17zjf8" # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True +DEBUG = os.environ.get('DJANGO_DEBUG', True) ALLOWED_HOSTS = ['*']