From 14d84b890f082e16102a52459613df2d5dd6cc90 Mon Sep 17 00:00:00 2001 From: Aditya Subramanian Date: Sun, 19 May 2024 10:56:27 -0400 Subject: [PATCH] pg docker init --- docker-compose.yml | 13 +++++++++++++ server/db.go | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..d52765e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +version: "3.9" +services: + db: + image: postgres:13.4 + restart: always + environment: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: turbo + ports: + - "5432:5432" + volumes: + - "./server/turbo.sql:/docker-entrypoint-initdb.d/1.sql" diff --git a/server/db.go b/server/db.go index 30a3e92..cd9dfbe 100644 --- a/server/db.go +++ b/server/db.go @@ -38,7 +38,7 @@ func GetQueries() *generated.Queries { } func createDBConnection(connectionCount int32) *pgxpool.Pool { - pgxConfig, err := pgxpool.ParseConfig("postgres://adisuper:adisuper@localhost:5432/turbo?sslmode=disable") + pgxConfig, err := pgxpool.ParseConfig("postgres://postgres:postgres@localhost:5432/turbo?sslmode=disable") if err != nil { panic(err) }