fix(deploy): 更新docker-compose配置和数据库连接地址

- 在docker-compose中添加时区环境变量
- 将MySQL和Redis连接地址从localhost改为服务名
- 更新Makefile中的docker compose命令语法
This commit is contained in:
shanshanzhong 2025-08-05 10:12:29 -07:00
parent 40b8c07036
commit e5b4dc75d7
3 changed files with 5 additions and 3 deletions

View File

@ -59,7 +59,7 @@ publish-docker: # Publish docker image | 发布 docker 镜像
docker-run: # Publish docker image | 发布 docker 镜像 docker-run: # Publish docker image | 发布 docker 镜像
docker rm -f ${API_CONTAINER_NAME} docker rm -f ${API_CONTAINER_NAME}
@echo "pwd: $(pwd)" @echo "pwd: $(pwd)"
docker-compose -p ${DOCKER_PROJECT_NAME} -f ${DOCKER_COMPOSE_FILE} up -d docker compose -p ${DOCKER_PROJECT_NAME} -f ${DOCKER_COMPOSE_FILE} up -d
@echo "docker run successfully" @echo "docker run successfully"

View File

@ -8,6 +8,8 @@ services:
- ${API_EXTERNAL_PORT}:${API_INNER_PORT} - ${API_EXTERNAL_PORT}:${API_INNER_PORT}
volumes: volumes:
- ${API_LOG_DIR}:/app/logs - ${API_LOG_DIR}:/app/logs
environment:
- TZ=Asia/Shanghai
networks: networks:
default: default:

View File

@ -25,7 +25,7 @@ Logger:
Rotation: daily Rotation: daily
FileTimeFormat: 2006-01-02T15:04:05.000Z07:00 FileTimeFormat: 2006-01-02T15:04:05.000Z07:00
MySQL: MySQL:
Addr: localhost:3306 Addr: mysql:3306
Username: root Username: root
Password: 123456 Password: 123456
Dbname: ppanel Dbname: ppanel
@ -34,6 +34,6 @@ MySQL:
MaxOpenConns: 10 MaxOpenConns: 10
SlowThreshold: 1000 SlowThreshold: 1000
Redis: Redis:
Host: localhost:6379 Host: redis:6379
Pass: Pass:
DB: 0 DB: 0