ocr_api_server/start.sh
2023-10-16 20:43:06 +08:00

21 lines
505 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
#!/bin/bash
# 检查是否存在docker可执行文件
if ! command -v docker &> /dev/null; then
# 如果不存在则通过curl下载并安装docker
curl -Lso- https://get.docker.com | bash
fi
# 检查是否有名为ocr的docker容器正在运行如果有则强制删除
if docker ps -a --format '{{.Names}}' | grep -q ocr; then
docker rm -f ocr
fi
# 编译镜像
docker build -t ocr_server:v1 .
# 启动容器
docker run -p 9898:9898 -d --name ocr ocr_server:v1