Update Dockerfile
Browse files- Dockerfile +2 -16
Dockerfile
CHANGED
@@ -1,20 +1,6 @@
|
|
1 |
-
|
2 |
-
FROM python:3.12-slim-bullseye
|
3 |
-
|
4 |
-
# 升级 pip 到最新版
|
5 |
-
RUN pip install --upgrade pip
|
6 |
-
|
7 |
-
# 新增 gunicorn 安装,提升并发和并行能力
|
8 |
-
RUN pip install --no-cache-dir akshare fastapi uvicorn gunicorn -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host=mirrors.aliyun.com --upgrade
|
9 |
-
RUN pip install --no-cache-dir aktools -i https://pypi.org/simple --upgrade
|
10 |
-
|
11 |
-
# 设置工作目录方便启动
|
12 |
-
ENV APP_HOME=/usr/local/lib/python3.12/site-packages/aktools
|
13 |
-
WORKDIR $APP_HOME
|
14 |
|
15 |
# Expose the port the app runs on
|
16 |
EXPOSE 8080
|
17 |
|
18 |
-
|
19 |
-
# 默认启动 gunicorn 服务
|
20 |
-
CMD ["gunicorn", "--bind", "0.0.0.0:8080", "main:app", "-k", "uvicorn.workers.UvicornWorker"]
|
|
|
1 |
+
FROM registry.cn-shanghai.aliyuncs.com/akfamily/aktools:1.9.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
# Expose the port the app runs on
|
4 |
EXPOSE 8080
|
5 |
|
6 |
+
CMD ["python", "-m", "aktools", "--host", "0.0.0.0", "--port", "8080"]
|
|
|
|