version: '3.8' services: # MySQL Database db: image: mysql:8.0 container_name: ppr_nextgen_db restart: unless-stopped environment: MYSQL_ROOT_PASSWORD: rootpassword123 MYSQL_DATABASE: ppr_nextgen MYSQL_USER: ppr_user MYSQL_PASSWORD: ppr_password123 ports: - "3307:3306" # Use different port to avoid conflicts volumes: - mysql_data:/var/lib/mysql - ./init_db.sql:/docker-entrypoint-initdb.d/01-schema.sql - ./02-import-data.sql:/docker-entrypoint-initdb.d/02-import-data.sql - ./airports_data_clean.csv:/var/lib/mysql-files/airports_data.csv - ./aircraft_data.csv:/var/lib/mysql-files/aircraft_data.csv networks: - ppr_network # FastAPI Backend api: build: ./backend container_name: ppr_nextgen_api restart: unless-stopped environment: DB_HOST: db DB_USER: ppr_user DB_PASSWORD: ppr_password123 DB_NAME: ppr_nextgen DB_PORT: 3306 SECRET_KEY: super-secret-key-for-nextgen-ppr-system-change-in-production ACCESS_TOKEN_EXPIRE_MINUTES: 30 API_V1_STR: /api/v1 PROJECT_NAME: "Airfield PPR API NextGen" ports: - "8001:8000" # Use different port to avoid conflicts with existing system depends_on: - db volumes: - ./backend:/app networks: - ppr_network command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload # Redis for caching (optional for now) redis: image: redis:7-alpine container_name: ppr_nextgen_redis restart: unless-stopped ports: - "6380:6379" # Use different port networks: - ppr_network # Nginx web server for public frontend web: image: nginx:alpine container_name: ppr_nextgen_web restart: unless-stopped ports: - "8082:80" # Public web interface volumes: - ./web:/usr/share/nginx/html - ./nginx.conf:/etc/nginx/nginx.conf depends_on: - api networks: - ppr_network volumes: mysql_data: networks: ppr_network: driver: bridge