Spaces:
Runtime error
Runtime error
Commit ·
34fda79
1
Parent(s): f5b7e2b
自动提交: 2026/03/24 周二 14:18:25.06
Browse files- Dockerfile +1 -1
- __pycache__/app.cpython-312.pyc +0 -0
- app.py +3 -0
- requirements.txt +1 -1
Dockerfile
CHANGED
|
@@ -13,4 +13,4 @@ COPY --chown=user ./requirements.txt requirements.txt
|
|
| 13 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 14 |
|
| 15 |
COPY --chown=user . /app
|
| 16 |
-
CMD ["
|
|
|
|
| 13 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 14 |
|
| 15 |
COPY --chown=user . /app
|
| 16 |
+
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "4", "app:app"]
|
__pycache__/app.cpython-312.pyc
ADDED
|
Binary file (6.14 kB). View file
|
|
|
app.py
CHANGED
|
@@ -101,5 +101,8 @@ def list_files():
|
|
| 101 |
|
| 102 |
return jsonify(files)
|
| 103 |
|
|
|
|
|
|
|
|
|
|
| 104 |
if __name__ == '__main__':
|
| 105 |
app.run(debug=True, host='0.0.0.0', port=5000)
|
|
|
|
| 101 |
|
| 102 |
return jsonify(files)
|
| 103 |
|
| 104 |
+
# 创建一个应用实例供gunicorn使用
|
| 105 |
+
application = app
|
| 106 |
+
|
| 107 |
if __name__ == '__main__':
|
| 108 |
app.run(debug=True, host='0.0.0.0', port=5000)
|
requirements.txt
CHANGED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
flask
|
| 2 |
-
|
|
|
|
| 1 |
flask
|
| 2 |
+
gunicorn
|