Some checks failed
Deploy Backend / deploy (push) Failing after 2m30s
- Remove flask-sse, Redis (unused) - Remove ImageService, file_utils (unused) - Remove /download-posters route (frontend handles download client-side) - Remove LETTERBOXD_API_URL, secure_filename (dead imports) - Fix duplicate TMDBService instantiation - Simplify config.py (remove REDIS_URL) - Fix gunicorn user home dir for control socket - Add .gitignore for __pycache__ - Add .gitea/workflows/deploy.yml for tag-based CI/CD
30 lines
872 B
Docker
30 lines
872 B
Docker
# backend/Dockerfile
|
|
FROM python:3.11-slim
|
|
|
|
RUN addgroup --system app && adduser --system --ingroup app --home /home/app app
|
|
|
|
WORKDIR /srv/app
|
|
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY . .
|
|
|
|
# Assurer permissions
|
|
RUN chown -R app:app /srv/app
|
|
|
|
USER app
|
|
|
|
# Port interne
|
|
EXPOSE 5000
|
|
|
|
# Variable d'environnement par défaut
|
|
ENV FLASK_ENV=production
|
|
ENV GUNICORN_WORKERS=2
|
|
ENV GUNICORN_THREADS=2
|
|
ENV GUNICORN_WORKER_CLASS=gevent
|
|
ENV GUNICORN_TIMEOUT=300
|
|
|
|
# Commande de démarrage via gunicorn (attache l'app Flask : app:app)
|
|
# Utilise timeout raisonnable, bind sur 0.0.0.0:5000
|
|
CMD ["sh","-c","gunicorn --workers ${GUNICORN_WORKERS} --threads ${GUNICORN_THREADS} --worker-class ${GUNICORN_WORKER_CLASS} --timeout ${GUNICORN_TIMEOUT} --worker-tmp-dir /dev/shm --bind 0.0.0.0:5000 --access-logfile - --error-logfile - 'main:create_app()'"] |