FIX: corregir permiso home de djangouser, warnings de regex y agregar CSRF_TRUSTED_ORIGINS para dominio publico

This commit is contained in:
Nachou-u
2026-09-09 13:03:20 -03:00
parent b9e676bed4
commit 1bfecb8f60
3 changed files with 3 additions and 2 deletions
+1 -2
View File
@@ -23,10 +23,9 @@ COPY . /app/
# Exponer el puerto # Exponer el puerto
EXPOSE 8000 EXPOSE 8000
# Crear un usuario no-root por seguridad (con home directory para Gunicorn) # Crear un usuario no-root por seguridad
RUN adduser --disabled-password djangouser RUN adduser --disabled-password djangouser
RUN chown -R djangouser:djangouser /app RUN chown -R djangouser:djangouser /app
RUN mkdir -p /app/media /app/static && chown -R djangouser:djangouser /app/media /app/static
USER djangouser USER djangouser
# Comando por defecto para iniciar Gunicorn con Uvicorn workers (Producción) # Comando por defecto para iniciar Gunicorn con Uvicorn workers (Producción)
+1
View File
@@ -33,6 +33,7 @@ SECRET_KEY = env('SECRET_KEY', default='django-insecure-fallback-key')
DEBUG = env('DEBUG') DEBUG = env('DEBUG')
ALLOWED_HOSTS = env.list('ALLOWED_HOSTS', default=['*']) ALLOWED_HOSTS = env.list('ALLOWED_HOSTS', default=['*'])
CSRF_TRUSTED_ORIGINS = env.list('CSRF_TRUSTED_ORIGINS', default=[])
# Application definition # Application definition
+1
View File
@@ -9,6 +9,7 @@ services:
restart: unless-stopped restart: unless-stopped
environment: environment:
REDIS_URL: redis://redis:6379/0 REDIS_URL: redis://redis:6379/0
CSRF_TRUSTED_ORIGINS: "https://${APP_DOMAIN}"
volumes: volumes:
- erp_media:/app/media - erp_media:/app/media
- erp_static:/app/static - erp_static:/app/static