version: '3.8' services: app: build: . container_name: freshman-intern-app restart: unless-stopped ports: - "8000:8000" environment: - DATABASE_URL=mysql+pymysql://root:password@db/freshman_intern - SECRET_KEY=your-secret-key-change-in-production - JWT_ALGORITHM=HS256 - ACCESS_TOKEN_EXPIRE_MINUTES=30 - ALLOWED_ORIGINS=http://localhost:3000,http://localhost:8000 depends_on: db: condition: service_healthy volumes: - ./logs:/app/logs - ./static:/app/static - ./templates:/app/templates networks: - freshman-network healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8000/health"] interval: 30s timeout: 10s retries: 3 start_period: 40s db: image: mysql:8.0 container_name: freshman-intern-db restart: unless-stopped environment: - MYSQL_ROOT_PASSWORD=password - MYSQL_DATABASE=freshman_intern - MYSQL_USER=app_user - MYSQL_PASSWORD=app_password ports: - "3306:3306" volumes: - mysql_data:/var/lib/mysql - ./mysql-init:/docker-entrypoint-initdb.d networks: - freshman-network healthcheck: test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-ppassword"] interval: 10s timeout: 5s retries: 5 nginx: image: nginx:alpine container_name: freshman-intern-nginx restart: unless-stopped ports: - "80:80" - "443:443" volumes: - ./nginx.conf:/etc/nginx/nginx.conf - ./ssl:/etc/nginx/ssl - ./static:/usr/share/nginx/html/static depends_on: - app networks: - freshman-network volumes: mysql_data: driver: local networks: freshman-network: driver: bridge