Skip to content

Docker 部署

sh
# 克隆项目
git clone https://github.com/sml2h3/ocr_api_server.git

cd ocr_api_server

# 修改entrypoint.sh中的参数,默认9898端口,同时开启ocr模块以及目标检测模块

# 编译镜像
docker build -t ocr_server:v1 .

# 运行镜像
docker run -p 9898:9898 -d ocr_server:v1

API

sh
# 测试是否启动成功
curl http://localhost:9898/ping

curl -F 'image=@/Users/1.png'  http://localhost:9898/ocr/file/json
{"status": 200, "result": "2AMLyA", "msg": ""}

curl -F 'image=@/Users/1.png'  http://localhost:9898/ocr/file
2AMLyA

Reference