@@ -0,0 +1,15 @@
+FROM python:3.11-slim
+
+WORKDIR /app
+COPY requirements.txt .
+RUN pip install --no-cache-dir -r requirements.txt
+# 安装 gunicorn 用于生产环境运行 Flask
+RUN pip install --no-cache-dir gunicorn
+COPY . .
+EXPOSE 8888
+CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:8888", "app:app"]
@@ -0,0 +1,33 @@
+services:
+ math-analysis:
+ build: .
+ ports:
+ - "8888:8888"
+ env_file:
+ - .env
+ restart: unless-stopped
+ networks:
+ - app-network
+ nginx:
+ image: nginx:alpine
+ - "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-analysis
+volumes:
+ nginx-logs:
+networks:
+ app-network:
+ driver: bridge