7dcc7dc0e1
This adds nginx dual-path routing, forwarded proxy headers, Uvicorn proxy-headers, production security settings, and deployment docs for https://sinbad2.ujaen.es/generadorexamenesllm/.
59 lines
1.6 KiB
YAML
59 lines
1.6 KiB
YAML
services:
|
|
backend:
|
|
build:
|
|
context: ./backend
|
|
env_file:
|
|
- ./backend/.env
|
|
environment:
|
|
DATABASE_URL: postgresql+psycopg://genexamenes:genexamenes@db:5432/genexamenes
|
|
ENVIRONMENT: ${ENVIRONMENT:-production}
|
|
PUBLIC_BASE_URL: ${PUBLIC_BASE_URL:-https://sinbad2.ujaen.es/generadorexamenesllm}
|
|
TRUSTED_HOSTS: ${TRUSTED_HOSTS:-sinbad2.ujaen.es,localhost,127.0.0.1}
|
|
# Sobrescribe backend/.env con el origen público del frontend en despliegue.
|
|
ALLOWED_ORIGINS: ${ALLOWED_ORIGINS:-https://sinbad2.ujaen.es,http://sinbad2.ujaen.es,http://sinbad2.ujaen.es:8075}
|
|
LLM_BASE_URL:
|
|
LLM_MODEL: qwen3.5:35b
|
|
LLM_TIMEOUT_SECONDS: "180"
|
|
ports:
|
|
- "${BACKEND_PORT:-8074}:8074"
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
volumes:
|
|
- uploads_data:/app/uploads
|
|
restart: unless-stopped
|
|
|
|
frontend:
|
|
build:
|
|
context: ./frontend
|
|
args:
|
|
VITE_APP_BASE_PATH: ${VITE_APP_BASE_PATH:-/generadorexamenesllm/}
|
|
VITE_API_URL: ${VITE_API_URL:-}
|
|
VITE_GOOGLE_CLIENT_ID: ${VITE_GOOGLE_CLIENT_ID:-}
|
|
ports:
|
|
- "${FRONTEND_PORT:-8075}:80"
|
|
depends_on:
|
|
- backend
|
|
restart: unless-stopped
|
|
|
|
db:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_DB: genexamenes
|
|
POSTGRES_USER: genexamenes
|
|
POSTGRES_PASSWORD: genexamenes
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U genexamenes -d genexamenes"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
postgres_data:
|
|
uploads_data:
|