Spaces:
Sleeping
Sleeping
Trae Assistant commited on
Commit ·
5acd5eb
1
Parent(s): 510f256
fix: change port to 7860 for huggingface spaces and fix permissions
Browse files- Dockerfile +4 -3
- app.py +1 -1
Dockerfile
CHANGED
|
@@ -21,10 +21,11 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
| 21 |
COPY . .
|
| 22 |
|
| 23 |
# 创建实例目录用于数据库持久化
|
| 24 |
-
RUN mkdir -p instance
|
|
|
|
| 25 |
|
| 26 |
# 暴露端口
|
| 27 |
-
EXPOSE
|
| 28 |
|
| 29 |
# 启动命令
|
| 30 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "
|
|
|
|
| 21 |
COPY . .
|
| 22 |
|
| 23 |
# 创建实例目录用于数据库持久化
|
| 24 |
+
RUN mkdir -p instance static
|
| 25 |
+
RUN chmod 777 instance static
|
| 26 |
|
| 27 |
# 暴露端口
|
| 28 |
+
EXPOSE 7860
|
| 29 |
|
| 30 |
# 启动命令
|
| 31 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
app.py
CHANGED
|
@@ -274,4 +274,4 @@ async def get_stats():
|
|
| 274 |
|
| 275 |
if __name__ == "__main__":
|
| 276 |
import uvicorn
|
| 277 |
-
uvicorn.run(app, host="0.0.0.0", port=
|
|
|
|
| 274 |
|
| 275 |
if __name__ == "__main__":
|
| 276 |
import uvicorn
|
| 277 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|