diff --git a/app_urls/core/settings.py b/app_urls/core/settings.py index a2357ae..7e19eac 100644 --- a/app_urls/core/settings.py +++ b/app_urls/core/settings.py @@ -27,6 +27,10 @@ DEBUG = (os.environ.get('DJANGO_DEBUG') == "True") ALLOWED_HOSTS = os.environ.get('DJANGO_ALLOWED_HOSTS', "*").split(",") +CSRF_TRUSTED_ORIGINS = os.environ.get('DJANGO_ALLOWED_ORIGINS', "*").split(",") +#CSRF_TRUSTED_ORIGINS = ["https://fetcher.matitos.org"] +#CSRF_ALLOWED_ORIGINS = ["https://fetcher.matitos.org"] +#CORS_ORIGINS_WHITELIST = ["https://fetcher.matitos.org"] # Application definition diff --git a/docker-compose.yml b/docker-compose.yml index 795254f..ebff2c4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -31,12 +31,13 @@ services: restart: unless-stopped environment: # Initialization - - INITIALIZE_DB=${INITIALIZE_DB:-false} # Related to DB persistence + - INITIALIZE_DB=${INITIALIZE_DB:-true} # Related to DB persistence - DJANGO_SUPERUSER_USERNAME=${DJANGO_SUPERUSER_USERNAME:-matitos} - DJANGO_SUPERUSER_PASSWORD=${DJANGO_SUPERUSER_PASSWORD:-matitos} - DJANGO_SUPERUSER_EMAIL=${DJANGO_SUPERUSER_EMAIL:-matitos@matitos.org} # Django - DJANGO_ALLOWED_HOSTS=${DJANGO_ALLOWED_HOSTS:-*} # host1,host2 + - DJANGO_ALLOWED_ORIGINS=${ALLOWED_ORIGINS:-https://fetcher.matitos.org} # Reverse proxy - DJANGO_SECRET_KEY=${DJANGO_SECRET_KEY:-abc123456789qwerty} - DJANGO_DEBUG=${DJANGO_DEBUG:-False} - PATH_LOGS_DIRECTORY=${PATH_LOGS_DIRECTORY:-/opt/logs} @@ -59,11 +60,11 @@ services: - SELENIUM_ENDPOINT=${SELENIUM_ENDPOINT:-http://fetcher_app_selenium:80} - ENDPOINT_OLLAMA=${ENDPOINT_OLLAMA:-https://ollamamodel.matitos.org} ######################## - volumes: # Dev mode - - ./app_urls:/opt/app + #volumes: # Development mode + # - ./app_urls:/opt/app ######################## ports: - - 8000:8000 + - 8000 # :8000 depends_on: - fetcher_db - fetcher_redis @@ -75,6 +76,14 @@ services: limits: cpus: '4' memory: 4G + labels: # Reverse proxy sample + - "traefik.enable=true" + - "traefik.http.routers.fetcher.rule=Host(`fetcher.matitos.org`)" + - "traefik.http.routers.fetcher.entrypoints=websecure" + - "traefik.http.routers.fetcher.tls.certresolver=myresolvercd" + networks: + - default # This network + - docker_default # Reverse proxy network fetcher_db: image: postgres:17 @@ -99,12 +108,6 @@ services: ports: - 6379 #:6379 - #fetcher_dozzle: - # container_name: fetcher_dozzle - # image: amir20/dozzle:latest - # volumes: - # - /var/run/docker.sock:/var/run/docker.sock:ro - # ports: - # - 8888:8080 - # environment: - # - DOZZLE_FILTER="name=fetcher_" +networks: + docker_default: + external: true