Skip to content

Commit

Permalink
修改dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
alisen39 committed May 6, 2020
1 parent 0c920e8 commit d84b3c0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
backend/libtorch/lib/libtorch.so
fontend/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN apt update && apt install -y libglib2.0-dev libsm6 libxrender1 libxext-dev
RUN pip install -r ./TrWebOCR/requirements.txt
RUN python ./TrWebOCR/install.py
EXPOSE 8089
CMD ["python"," TrWebOCR/backend/main.py"]
CMD ["python"," ./TrWebOCR/backend/main.py"]

# apt update && apt install -y libglib2.0-dev libsm6 libxrender1 libxext-dev
##
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,17 @@ python backend/main.py
server is running: 0.0.0.0:8089
```

### Docker部署
1. 编译 Dockerfile
### Docker部署
1. 编译 Dockerfile
```shell script
docker build -t TrWebOCR:latest .
```
通过Dockerfile能够快速且简单的部署
```

2. Docker run
```shell script
docker run -itd -p 8089:8089 --name trweb trweb-ocr:latest /bin/bash
```
这里把容器的8089端口映射到了物理机的8089上,但如果你不喜欢映射,去掉run后面的`-p 8089:8089` 也可以使用docker的IP加`8089`来访问

## 效果展示

Expand Down

0 comments on commit d84b3c0

Please sign in to comment.