@@ -0,0 +1,12 @@
+
+# 第一个阶段:构建阶段
+FROM python:3.12-slim
+# 设置工作目录
+WORKDIR /app
+COPY . /app
+# 复制 requirements.txt 并运行 pip install 在单独的镜像层中
+RUN pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
+# RUN pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
+# CMD ["gunicorn", "-c", "gu_docker.py", "main.wsgi:application"]
@@ -0,0 +1,18 @@
+version: '3.8'
+services:
+ web:
+ build: .
+ command: /bin/bash -c "python manage.py runserver"
+ # command: /bin/bash -c "gunicorn -c gu_docker.py main.wsgi:application"
+ environment:
+ - DJANGO_ONLINE=1
+ volumes:
+ # - /data/logs:/data/logs
+ - /data/www/yixuedjango.cxhy.cn/code:/app
+ # - /data/www/cxAIServer:/data/www/cxAIServer
+ ports:
+ - "16003:80"
+ restart: unless-stopped