添加yohe私有部署

This commit is contained in:
zzq 2024-09-22 12:11:29 +08:00
parent f9e3624eff
commit 9e1cd03020
4 changed files with 24 additions and 1 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
__pycache__
common.mk

View File

@ -14,4 +14,4 @@ RUN pip install --no-cache-dir -r requirements.txt
EXPOSE 8000
# 运行应用
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
CMD ["python", "app/main.py"]

12
Makefile Normal file
View File

@ -0,0 +1,12 @@
include common.mk
.PHONY: build-image push-image
build-image:
docker build --pull \
-t="$(DOCKERHUB_ORGANIZATION)/$(DOCKERHUB_IMAGE):$(DOCKERHUB_TAG)" \
-f Dockerfile .
push-image:
docker login --username=$(DOCKERHUB_USERNAME) -p $(DOCKERHUB_PASSWORD) $(DOCKERHUB_REGISTRY)
docker push "$(DOCKERHUB_ORGANIZATION)/$(DOCKERHUB_IMAGE):$(DOCKERHUB_TAG)"

9
common.example.mk Normal file
View File

@ -0,0 +1,9 @@
COMMIT_ID = $(shell git rev-parse --short HEAD || echo "HEAD")
DOCKERHUB_ORGANIZATION = registry.cn-shanghai.aliyuncs.com/muzimu
DOCKERHUB_IMAGE = yohe-ddddocr
DOCKERHUB_TAG = ${COMMIT_ID}
DOCKERHUB_USERNAME = <username>
DOCKERHUB_PASSWORD = <password>
DOCKERHUB_REGISTRY = registry.cn-shanghai.aliyuncs.com