From 7cd02ac6f385410bde29235eaa565b5d357beb64 Mon Sep 17 00:00:00 2001 From: ^~^ Date: Wed, 15 Apr 2026 15:54:51 +0200 Subject: [PATCH] edit docker compose --- cmd/main.go | 2 +- docker-compose.yml | 19 +++++++++++-------- go.mod | 2 +- internal/entry/entry.go | 6 +++--- internal/entry/webServer.go | 2 +- internal/handler/addPerson.go | 6 +++--- internal/handler/delPerson.go | 2 +- internal/handler/getPerson.go | 6 +++--- internal/handler/handler.go | 4 ++-- internal/handler/updPerson.go | 6 +++--- internal/handler/utils.go | 4 ++-- internal/repository/repository.go | 4 ++-- internal/repository/utils.go | 2 +- internal/service/service.go | 2 +- 14 files changed, 35 insertions(+), 32 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index 5a45559..be2d396 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -3,7 +3,7 @@ package main import ( "fmt" - "github.com/fprofit/EffectiveMobile/internal/entry" + "github.com/fprofit/testTask/internal/entry" ) func main() { diff --git a/docker-compose.yml b/docker-compose.yml index 3fc9b33..51e6a80 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,35 +1,38 @@ version: "3.8" + services: app: container_name: app - build: "." + build: . ports: - "${APP_PORT}:${APP_PORT}" restart: always env_file: - .env depends_on: - - "postgres" + - postgres networks: - app postgres: container_name: postgres - image: - postgres:15.2-alpine + image: postgres:15.2-alpine environment: POSTGRES_DB: ${DB_NAME} POSTGRES_USER: ${DB_USER} POSTGRES_PASSWORD: ${DB_PASSWORD} - PGDATA: "/var/lib/postgresql/data/pgdata" + PGDATA: /var/lib/postgresql/data/pgdata volumes: - - .:/var/lib/postgresql/data + - pgdata:/var/lib/postgresql/data ports: - - "${DB_PORT}:${DB_PORT}" + - "${DB_PORT}:5432" env_file: - .env networks: - app networks: - app: \ No newline at end of file + app: + +volumes: + pgdata: \ No newline at end of file diff --git a/go.mod b/go.mod index 2e83887..95703cd 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/fprofit/EffectiveMobile +module github.com/fprofit/testTask go 1.21 diff --git a/internal/entry/entry.go b/internal/entry/entry.go index 7157be5..8fbc276 100644 --- a/internal/entry/entry.go +++ b/internal/entry/entry.go @@ -5,9 +5,9 @@ import ( "os" "os/signal" - "github.com/fprofit/EffectiveMobile/internal/handler" - "github.com/fprofit/EffectiveMobile/internal/repository" - "github.com/fprofit/EffectiveMobile/internal/service" + "github.com/fprofit/testTask/internal/handler" + "github.com/fprofit/testTask/internal/repository" + "github.com/fprofit/testTask/internal/service" "github.com/sirupsen/logrus" ) diff --git a/internal/entry/webServer.go b/internal/entry/webServer.go index 51a75ec..0cedd05 100644 --- a/internal/entry/webServer.go +++ b/internal/entry/webServer.go @@ -7,7 +7,7 @@ import ( "net/http" "time" - "github.com/fprofit/EffectiveMobile/internal/handler" + "github.com/fprofit/testTask/internal/handler" "github.com/gin-gonic/gin" "github.com/sirupsen/logrus" diff --git a/internal/handler/addPerson.go b/internal/handler/addPerson.go index e296ea6..20a7f1d 100644 --- a/internal/handler/addPerson.go +++ b/internal/handler/addPerson.go @@ -3,9 +3,9 @@ package handler import ( "net/http" - "github.com/fprofit/EffectiveMobile/internal/errorResponse" - "github.com/fprofit/EffectiveMobile/internal/models" - "github.com/fprofit/EffectiveMobile/internal/utils" + "github.com/fprofit/testTask/internal/errorResponse" + "github.com/fprofit/testTask/internal/models" + "github.com/fprofit/testTask/internal/utils" "github.com/gin-gonic/gin" ) diff --git a/internal/handler/delPerson.go b/internal/handler/delPerson.go index 088e018..5fcf3aa 100644 --- a/internal/handler/delPerson.go +++ b/internal/handler/delPerson.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/fprofit/EffectiveMobile/internal/errorResponse" + "github.com/fprofit/testTask/internal/errorResponse" "github.com/gin-gonic/gin" ) diff --git a/internal/handler/getPerson.go b/internal/handler/getPerson.go index e2947bd..3e495dc 100644 --- a/internal/handler/getPerson.go +++ b/internal/handler/getPerson.go @@ -3,9 +3,9 @@ package handler import ( "net/http" - "github.com/fprofit/EffectiveMobile/internal/errorResponse" - "github.com/fprofit/EffectiveMobile/internal/models" - "github.com/fprofit/EffectiveMobile/internal/utils" + "github.com/fprofit/testTask/internal/errorResponse" + "github.com/fprofit/testTask/internal/models" + "github.com/fprofit/testTask/internal/utils" "github.com/gin-gonic/gin" ) diff --git a/internal/handler/handler.go b/internal/handler/handler.go index 3c1143e..bc63eca 100644 --- a/internal/handler/handler.go +++ b/internal/handler/handler.go @@ -1,8 +1,8 @@ package handler import ( - _ "github.com/fprofit/EffectiveMobile/docs" - "github.com/fprofit/EffectiveMobile/internal/models" + _ "github.com/fprofit/testTask/docs" + "github.com/fprofit/testTask/internal/models" "github.com/gin-gonic/gin" "github.com/sirupsen/logrus" diff --git a/internal/handler/updPerson.go b/internal/handler/updPerson.go index ba83f00..5fee789 100644 --- a/internal/handler/updPerson.go +++ b/internal/handler/updPerson.go @@ -6,9 +6,9 @@ import ( "net/http" "strconv" - "github.com/fprofit/EffectiveMobile/internal/errorResponse" - "github.com/fprofit/EffectiveMobile/internal/models" - "github.com/fprofit/EffectiveMobile/internal/utils" + "github.com/fprofit/testTask/internal/errorResponse" + "github.com/fprofit/testTask/internal/models" + "github.com/fprofit/testTask/internal/utils" "github.com/gin-gonic/gin" ) diff --git a/internal/handler/utils.go b/internal/handler/utils.go index 386cec0..35ea878 100644 --- a/internal/handler/utils.go +++ b/internal/handler/utils.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - "github.com/fprofit/EffectiveMobile/internal/models" - "github.com/fprofit/EffectiveMobile/internal/utils" + "github.com/fprofit/testTask/internal/models" + "github.com/fprofit/testTask/internal/utils" ) func checkJSONAddPerson(person models.Person) error { diff --git a/internal/repository/repository.go b/internal/repository/repository.go index 3fbacc8..b1b5eb1 100644 --- a/internal/repository/repository.go +++ b/internal/repository/repository.go @@ -4,8 +4,8 @@ import ( "database/sql" "fmt" - "github.com/fprofit/EffectiveMobile/internal/models" - "github.com/fprofit/EffectiveMobile/internal/utils" + "github.com/fprofit/testTask/internal/models" + "github.com/fprofit/testTask/internal/utils" "github.com/jmoiron/sqlx" "github.com/sirupsen/logrus" ) diff --git a/internal/repository/utils.go b/internal/repository/utils.go index 257da56..f8a1157 100644 --- a/internal/repository/utils.go +++ b/internal/repository/utils.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/fprofit/EffectiveMobile/internal/models" + "github.com/fprofit/testTask/internal/models" ) func createFilterQuery(filter models.PersonFilter) string { diff --git a/internal/service/service.go b/internal/service/service.go index bab7365..b9c57ea 100644 --- a/internal/service/service.go +++ b/internal/service/service.go @@ -1,7 +1,7 @@ package service import ( - "github.com/fprofit/EffectiveMobile/internal/models" + "github.com/fprofit/testTask/internal/models" "github.com/sirupsen/logrus" )