From 366dba2f17f81ea567012c2b5caea39f12345b85 Mon Sep 17 00:00:00 2001 From: Kobe Date: Wed, 4 Jun 2025 08:25:23 +0200 Subject: [PATCH] test --- Dockerfile | 19 +++++++++++++++++++ docker-compose.yml | 4 +++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 94c13f8..f315ae6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,6 +21,16 @@ RUN pip install --no-cache-dir -r requirements.txt # Copy application code COPY . . +# Debug: List files and check tasks.py +RUN ls -la /app && \ + echo "Checking tasks.py:" && \ + if [ -f /app/tasks.py ]; then \ + echo "tasks.py exists" && \ + cat /app/tasks.py; \ + else \ + echo "tasks.py does not exist"; \ + fi + # Create necessary directories and set permissions RUN mkdir -p /app/uploads /app/static/uploads && \ chown -R celery:celery /app @@ -49,6 +59,15 @@ echo "Starting application..."\n\ exec "$@"' > /app/entrypoint.sh && \ chmod +x /app/entrypoint.sh +# Set environment variables +ENV PYTHONPATH=/app +ENV FLASK_APP=app.py +ENV FLASK_ENV=production + +# Make sure tasks.py is executable and has correct permissions +RUN chmod 644 /app/tasks.py && \ + chown celery:celery /app/tasks.py + # Switch to non-root user USER celery diff --git a/docker-compose.yml b/docker-compose.yml index 42969cf..65bdf6e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ version: '3.8' services: web: build: - context: . + context: https://git.kobeamerijckx.com/Kobe/docupulse dockerfile: Dockerfile command: gunicorn --bind 0.0.0.0:5000 app:app ports: @@ -11,6 +11,7 @@ services: environment: - FLASK_APP=app.py - FLASK_ENV=production + - PYTHONPATH=/app - DATABASE_URL=postgresql://postgres:postgres@db:5432/docupulse - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres @@ -73,6 +74,7 @@ services: environment: - FLASK_APP=app.py - FLASK_ENV=production + - PYTHONPATH=/app - DATABASE_URL=postgresql://postgres:postgres@db:5432/docupulse - REDIS_URL=redis://redis:6379/0 depends_on: