services:
  math-questions:
    build: .
    # 不再直接暴露端口，通过 Nginx 访问
    # ports:
    #   - "8100:8100"
    env_file:
      - .env
    restart: unless-stopped
    networks:
      - app-network

  nginx:
    image: nginx:alpine
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
      - ./ssl:/etc/nginx/ssl:ro
      - nginx-logs:/var/log/nginx
    depends_on:
      - math-questions
    restart: unless-stopped
    networks:
      - app-network

volumes:
  nginx-logs:


networks:
  app-network:
    driver: bridge
