Spaces:
Runtime error
Runtime error
Trae Assistant commited on
Commit ·
e53f24a
1
Parent(s): 58a202f
重新配置 dc
Browse files- Dockerfile +2 -14
- app.py +1 -2
Dockerfile
CHANGED
|
@@ -1,22 +1,10 @@
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
| 3 |
-
|
| 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 |
-
|
| 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 |
-
|
| 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)
|
|
|