Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加服务端的docker版本 #54

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 使用官方 Python 3.10 镜像
FROM python:3.10

# 设置工作目录
WORKDIR /app

# 克隆项目代码
RUN git clone https://github.com/HaujetZhao/CapsWriter-Offline.git .

# 安装 requirements-server.txt 中的依赖
RUN pip install --no-cache-dir -r requirements-server.txt

# 给 core_server.py 脚本执行权限
RUN chmod +x core_server.py

# 暴露端口 6016
EXPOSE 6016

# 容器启动时运行 run.sh 脚本
CMD ["python", "./core_server.py"]
21 changes: 21 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: '3.8'
services:
capswriter:
build:
context: .

# 无法正常访问github时请按下列格式添加代理

# args:
# - http_proxy=http://192.168.3.2:11088
# - https_proxy=http://192.168.3.2:11088
# - no_proxy=localhost,127.0.0.1

# 可以将6016替换为你想使用的端口
ports:
- "6016:6016"
restart: unless-stopped
container_name: capswriter
# 请将models目录替换为你的模型目录,并将模型文件放入其中
volumes:
- ./models:/app/models