services:
  frontend:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: nexus-auth-frontend
    restart: unless-stopped
    ports:
      - '${FRONTEND_PORT:-3000}:3000'
    environment:
      - NODE_ENV=production
      - PUBLIC_KRATOS_URL=${PUBLIC_KRATOS_URL}
      - KRATOS_SERVER_URL=${KRATOS_SERVER_URL}
      - ORIGIN=${ORIGIN}
      - ADMIN_USER_ID=${ADMIN_USER_ID}
    networks:
      - ory-network
    healthcheck:
      test: ['CMD', 'curl', '-f', 'http://localhost:3000/']
      interval: 30s
      timeout: 5s
      retries: 5
      start_period: 10s

networks:
  ory-network:
    external: true
    name: ory-network
