services:
  backend:
    build: ./backend
    restart: always
    environment:
      - DB_HOST=${DB_HOST:-host.docker.internal}
      - DB_USER=${DB_USER:-masterprogram_dev_user}
      - DB_PASSWORD=${DB_PASSWORD:-2sm1W&R.ZVE!Ofht}
      - DB_NAME=${DB_NAME:-masterprogram_numerology_master}
      - DB_PORT=3306
      - PORT=5000
      - NODE_ENV=production
      - JWT_SECRET=your_super_secret_jwt_key
      - JWT_REFRESH_SECRET=your_refresh_secret
      - CORS_ORIGIN=http://localhost:3000
    ports:
      - "5000:5000"
    extra_hosts:
      - "host.docker.internal:host-gateway"
    networks:
      - app-network

  frontend:
    build:
      context: ./frontend
      args:
        VITE_API_URL: http://locahost:5000/api
    restart: always
    ports:
      - "3000:80"
    depends_on:
      - backend
    networks:
      - app-network

networks:
  app-network:
    driver: bridge
