fix docker

This commit is contained in:
liangzai 2025-06-08 15:19:15 +08:00
parent e75c7b3dd3
commit 9344532b24
3 changed files with 85 additions and 86 deletions

View File

@ -14,8 +14,8 @@ ADD go.mod .
ADD go.sum .
RUN go mod download
COPY . .
COPY app/user/cmd/api/etc /app/etc
RUN go build -ldflags="-s -w" -o /app/main app/main/cmd/api/main.go
COPY app/main/api/etc /app/etc
RUN go build -ldflags="-s -w" -o /app/main app/main/api/main.go
FROM scratch

View File

@ -26,7 +26,7 @@ func main() {
// 根据 ENV 加载不同的配置文件
var defaultConfigFile string
if env == "development" {
defaultConfigFile = "app/main/cmd/api/etc/main.dev.yaml"
defaultConfigFile = "app/main/api/etc/main.dev.yaml"
} else {
defaultConfigFile = "etc/main.yaml"
}

View File

@ -1,7 +1,6 @@
version: '3'
version: "3"
services:
mysql:
image: mysql:8.0.34
container_name: tydata_mysql
@ -58,8 +57,8 @@ services:
environment:
- TZ=Asia/Shanghai
command:
- '--redis-addr=tydata_redis:6379'
- '--redis-password=3m3WsgyCKWqz'
- "--redis-addr=tydata_redis:6379"
- "--redis-password=3m3WsgyCKWqz"
restart: always
networks:
- tydata_net
@ -70,7 +69,7 @@ services:
container_name: tydata_main
build:
context: .
dockerfile: app/main/cmd/api/Dockerfile
dockerfile: app/main/api/Dockerfile
ports:
- "21004:8888"
environment: