Skip to content

Commit de0afe7

Browse files
committed
整体项目重构
1 parent 7f37543 commit de0afe7

18 files changed

+477
-506
lines changed

Dockerfile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
FROM python:3.8-slim-buster
1+
# 使用官方 Python 运行时作为父镜像
2+
FROM python:3.9-slim
23

3-
RUN mkdir /app
4-
5-
COPY ./*.txt ./*.py ./*.sh ./*.onnx /app/
4+
# 设置工作目录
5+
WORKDIR /app
66

7+
# 将当前目录内容复制到容器的 /app 中
8+
COPY . /app
79

8-
RUN cd /app \
9-
&& python3 -m pip install --upgrade pip -i https://pypi.douban.com/simple/\
10-
&& pip3 install --no-cache-dir -r requirements.txt --extra-index-url https://pypi.douban.com/simple/ \
11-
&& rm -rf /tmp/* && rm -rf /root/.cache/* \
12-
&& sed -i 's#http://deb.debian.org#http://mirrors.aliyun.com/#g' /etc/apt/sources.list\
13-
&& apt-get --allow-releaseinfo-change update && apt install libgl1-mesa-glx libglib2.0-0 -y
10+
# 安装项目依赖
11+
RUN pip install --no-cache-dir -r requirements.txt
1412

15-
WORKDIR /app
13+
# 暴露端口 8000
14+
EXPOSE 8000
1615

17-
CMD ["python3", "ocr_server.py", "--port", "9898", "--ocr", "--det"]
16+
# 运行应用
17+
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]

LICENSE

Lines changed: 0 additions & 201 deletions
This file was deleted.

0 commit comments

Comments
 (0)