#******** MODIFY THE FOLLOWING VARIABLES TO YOUR OWN SETTINGS ********#
# 构建说明：
# 1. docker-compose.yaml文件放置目录为：/deploy/docker-compose/project/
# 2. 将swagger json文件添加至 api dockerfile的app目录中，用于两个容器之间的文件中转。

# PROJECT DEFINE
export DOCKER_COMPOSE_FILE=deploy/project/docker-compose.yaml
export APIDOC_DOCKER_COMPOSE_FILE=deploy/project/swagger.yaml
export ALIYUN_URL=registry.cn-shanghai.aliyuncs.com
export ALI_NAMESPACE=1024studiobyzzx # 阿里云镜像仓库 命名空间
export PROJECT_NAME=mini-chat # 用于docker-compose文件中的项目名称 
export SERVICE_NAME=mini-chat # swagger json文件名称
export DOMAIN=mini-chat.1024tool.vip
export BACKEND_PREFIX=mms # nginx反向代理apidoc的前缀
# DOCKER VARS
export DOCKER_PROJECT_NAME=${PROJECT_NAME}-${SERVICE_NAME}  # 项目名称，需要保持全局唯一
export DOC_DOCKER_PROJECT_NAME=${PROJECT_NAME}-${SERVICE_NAME} # 接口文档容器项目名称，需要保持全局唯一
export DOCKER_NETWORK_NAME=${PROJECT_NAME}-${SERVICE_NAME} # 项目网络名称，需要保持全局唯一

# API DOCKER DEFINE don't forget modify the service name in docker-compose file
export API_PROJECT_BUILD_SUFFIX=api
export API_EXTERNAL_PORT=9991
export API_INNTER_PORT=9991
export API_LOG_DIR=/home/logs/${PROJECT_NAME}-${SERVICE_NAME}/${API_PROJECT_BUILD_SUFFIX}
# APIDOC DOCKER DEFINE don't forget add swagger json file to api docker file 
export SWAGGER_INVOKE_URL=${DOMAIN}/${BACKEND_PREFIX}-${API_PROJECT_BUILD_SUFFIX}
# export APIDOC_MOUNT_PATH=/install/apidocs/${PROJECT_NAME}-${SERVICE_NAME} # must create a directory in host machine,it will mount to docker container
export APIDOC_PORT_DEFINE=9992
export APIDOC_BUILD_SUFFIX=apidoc
export SWAGGER_FILE_NAME=${SERVICE_NAME}.json #参照api desc中定义的service名称
export HOST_APIDOC_DIRCTORY=/install/cicd_env_files/
export GITEA_RUNNER_NAME=gitea-runner #*修改为你自己的gitea-runner容器名称

#******** DON'T MODIFY THE FOLLOWING VARIABLES  ********#
#### API ENVS
export API_IMAGE_NAME=${ALIYUN_URL}/${ALI_NAMESPACE}/${PROJECT_NAME}-${SERVICE_NAME}-${API_PROJECT_BUILD_SUFFIX}
export API_CONTAINER_NAME=${PROJECT_NAME}-${SERVICE_NAME}-${API_PROJECT_BUILD_SUFFIX}
### APIDOC ENVS
# export SWAGGER_FILE_SOURCE=${JOB_CONTAINER_NAME}:${PWD}/${SERVICE_NAME}.json
export APIDOC_CONTAINER_NAME=${PROJECT_NAME}-${SERVICE_NAME}-apidoc
export APIDOC_PORT=${APIDOC_PORT_DEFINE}
# export APIDOC_HOST_MOUNT_PATH=${APIDOC_MOUNT_PATH}  # 从Gitea Runner容器中scp出swagger json的宿主机路径，目前是在API容器中拷贝出来
export APIDOC_CONTAINER_DIRECOTRY=/docs/ # 从宿主机挂机载Swagger-UI容器的目录
export SWAGGER_JSON=/docs/swagger.json # 指定Swagger-UI容器加载JSON文档的路径
export APIDOC_FROM_CONTAINER_NAME=${PROJECT_NAME}-${SERVICE_NAME}-${API_PROJECT_BUILD_SUFFIX}