Trae Assistant commited on
Commit
e53f24a
·
1 Parent(s): 58a202f

重新配置 dc

Browse files
Files changed (2) hide show
  1. Dockerfile +2 -14
  2. app.py +1 -2
Dockerfile CHANGED
@@ -1,22 +1,10 @@
1
  FROM python:3.9-slim
2
 
3
- # Install Chinese fonts for Pillow to use as fallback
4
- RUN apt-get update && apt-get install -y --no-install-recommends \
5
- fonts-wqy-zenhei \
6
- fonts-noto-cjk \
7
- && rm -rf /var/lib/apt/lists/*
8
-
9
- RUN useradd -m -u 1000 user
10
- USER user
11
- ENV HOME=/home/user \
12
- PATH=/home/user/.local/bin:$PATH
13
- WORKDIR /home/user/app
14
 
15
  COPY requirements.txt .
16
  RUN pip install --no-cache-dir -r requirements.txt
17
 
18
  COPY . .
19
 
20
- EXPOSE 7860
21
-
22
- CMD ["python", "app.py"]
 
1
  FROM python:3.9-slim
2
 
3
+ WORKDIR /app
 
 
 
 
 
 
 
 
 
 
4
 
5
  COPY requirements.txt .
6
  RUN pip install --no-cache-dir -r requirements.txt
7
 
8
  COPY . .
9
 
10
+ CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]
 
 
app.py CHANGED
@@ -177,5 +177,4 @@ def generate_certificates():
177
  return jsonify({"error": str(e)}), 500
178
 
179
  if __name__ == "__main__":
180
- port = int(os.environ.get("PORT", "7860"))
181
- app.run(host="0.0.0.0", port=port, debug=False)
 
177
  return jsonify({"error": str(e)}), 500
178
 
179
  if __name__ == "__main__":
180
+ app.run(host="0.0.0.0", port=7860, debug=False)