From 22dc82e0524ad8a134a4276d1803c676d3c12eac Mon Sep 17 00:00:00 2001 From: laoboli <1293528695@qq.com> Date: Fri, 21 Mar 2025 10:36:09 +0800 Subject: [PATCH] refactor: docker file. --- config.yaml | 2 +- controllers/train.go | 2 +- docker-compose.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config.yaml b/config.yaml index e744097..ea3dcf2 100644 --- a/config.yaml +++ b/config.yaml @@ -1,5 +1,5 @@ database: - host: localhost + host: localhost #when use docker change to "db" port: 5432 user: postgres password: root diff --git a/controllers/train.go b/controllers/train.go index 42429ff..bc0cc48 100644 --- a/controllers/train.go +++ b/controllers/train.go @@ -74,7 +74,7 @@ func (tc *TrainingController) CreateTrainingRecord(c *gin.Context) { } c.JSON(http.StatusCreated, gin.H{ - "message": "Data saved successfully", + "message": "数据保存成功", "id": record.TrainId, }) } diff --git a/docker-compose.yml b/docker-compose.yml index b25b4a1..51b759d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ services: app: build: . ports: - - "8080:8080" + - "8080:8180" depends_on: db: condition: service_healthy @@ -27,7 +27,7 @@ services: timeout: 5s retries: 5 ports: - - "5432:5432" + - "127.0.0.1:5432:5432" volumes: pgdata: