# Panel madre en el VPS, detrás de Traefik (Coolify) con HTTPS Let's Encrypt. # docker compose -f panel/docker-compose.yml up -d --build # # Persistencia: TODO el estado vive en el host vía el bind mount del repo # (/opt/collina-smart-assistant): panel/panel.db, panel/.env (llave maestra, # vía env_file), replicas/ y registry.json. Recrear el contenedor NO pierde # admins ni fichas cifradas. # # Seguridad: SIN `ports:` — el 8090 no se publica al host; solo Traefik # lo alcanza por la red `coolify`. SIN PANEL_COOKIE_SECURE: el default es # true (cookie Secure), correcto detrás de HTTPS real. name: csa-panel services: panel: build: context: .. dockerfile: panel/Dockerfile image: csa-panel container_name: csa-panel restart: unless-stopped env_file: - .env # → /opt/collina-smart-assistant/panel/.env (PANEL_MASTER_KEY ya generada en el VPS) environment: PANEL_DB: /opt/collina-smart-assistant/panel/panel.db volumes: # Repo completo, MISMA ruta que el host: código + .git (estampar) + # panel.db + replicas/. Es la capa de persistencia. - /opt/collina-smart-assistant:/opt/collina-smart-assistant # Socket del daemon del HOST: habilita el botón «Desplegar» (el # contenedor solo trae el CLI). Nota de seguridad: el socket equivale # a root en el host; el panel exige login y no publica puertos. - /var/run/docker.sock:/var/run/docker.sock networks: - coolify healthcheck: test: ["CMD", "python", "-c", "import urllib.request as u; u.urlopen('http://localhost:8090/health', timeout=3)"] interval: 30s timeout: 5s retries: 3 start_period: 15s labels: - traefik.enable=true - traefik.http.middlewares.gzip.compress=true - traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https - traefik.http.routers.http-csa-panel.entryPoints=http - traefik.http.routers.http-csa-panel.middlewares=redirect-to-https - traefik.http.routers.http-csa-panel.rule=Host(`csa.collinasystems.com.mx`) && PathPrefix(`/`) - traefik.http.routers.http-csa-panel.service=csa-panel - traefik.http.routers.https-csa-panel.entryPoints=https - traefik.http.routers.https-csa-panel.middlewares=gzip - traefik.http.routers.https-csa-panel.rule=Host(`csa.collinasystems.com.mx`) && PathPrefix(`/`) - traefik.http.routers.https-csa-panel.service=csa-panel - traefik.http.routers.https-csa-panel.tls=true - traefik.http.routers.https-csa-panel.tls.certresolver=letsencrypt - traefik.http.services.csa-panel.loadbalancer.server.port=8090 networks: coolify: external: true