feat: Add Docker Compose configuration for PostgreSQL and update database credentials in main.go

This commit is contained in:
2025-03-10 22:25:03 +00:00
parent 8785b86bfc
commit dde2017ad1
2 changed files with 24 additions and 8 deletions
+2 -2
View File
@@ -41,9 +41,9 @@ func main() {
dbConfig := models.DatabaseConfig{ dbConfig := models.DatabaseConfig{
Host: "localhost", Host: "localhost",
Port: 5432, Port: 5432,
User: "postgres", User: "timetracker",
Password: "password", Password: "password",
DBName: "mydatabase", DBName: "timetracker",
SSLMode: "disable", // For development environment SSLMode: "disable", // For development environment
} }
+16
View File
@@ -0,0 +1,16 @@
services:
db:
image: postgres:14
container_name: timetracker_db
restart: always
ports:
- "5432:5432"
environment:
POSTGRES_USER: timetracker
POSTGRES_PASSWORD: password
POSTGRES_DB: timetracker
volumes:
- db_data:/var/lib/postgresql/data
volumes:
db_data: