services:
  app:
    build: 
      context: .
      args:
        - DATABASE_URL=${DATABASE_URL}
        - SMS_AERO_EMAIL=${SMS_AERO_EMAIL}
        - SMS_AERO_API_KEY=${SMS_AERO_API_KEY}
        - SMS_AERO_API_URL=${SMS_AERO_API_URL}
        - DADATA_API_KEY=${DADATA_API_KEY}
        - DADATA_API_URL=${DADATA_API_URL}
        - WILDBERRIES_API_URL=${WILDBERRIES_API_URL}
        - OZON_API_URL=${OZON_API_URL}
        - JWT_SECRET=${JWT_SECRET}
        - SMS_DEV_MODE=${SMS_DEV_MODE}
    ports:
      - "127.0.0.1:3017:3000"  # Привязка только к localhost
    env_file:
      - .env
    environment:
      - NODE_ENV=production
      - PORT=3000
      - HOSTNAME=0.0.0.0
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/health"]
      timeout: 10s
      interval: 30s
      retries: 3
      start_period: 40s
    # Логирование
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "3" 