version: '3.8'

services:
  nuxt-app:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: analiticanucleo-nuxt-app
    restart: unless-stopped
    environment:
      - NODE_ENV=production
      - SUPABASE_URL=${SUPABASE_URL}
      - SUPABASE_ANON_KEY=${SUPABASE_ANON_KEY}
      - NEXT_PUBLIC_SUPABASE_URL=${SUPABASE_URL}
      - NEXT_PUBLIC_SUPABASE_ANON_KEY=${SUPABASE_ANON_KEY}
    networks:
      - principal
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.analiticanucleo.rule=Host(`analitica.nucleoriofrio.com`)"
      - "traefik.http.routers.analiticanucleo.entrypoints=websecure"
      - "traefik.http.routers.analiticanucleo.tls=true"
      - "traefik.http.routers.analiticanucleo.tls.certresolver=letsencrypt"
      - "traefik.http.services.analiticanucleo.loadbalancer.server.port=3000"
      - "traefik.docker.network=principal"

networks:
  principal:
    external: true
