From db982731e7ba5773276c4d10d75326019596d299 Mon Sep 17 00:00:00 2001 From: Mika Bomm Date: Thu, 27 Mar 2025 12:06:00 +0100 Subject: [PATCH] Add Docker Compose setup with PostgreSQL and Redis services --- .env.example | 3 +++ .gitignore | 6 +++--- dev-compose.yml | 27 +++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 .env.example create mode 100644 dev-compose.yml diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..d78c3ae --- /dev/null +++ b/.env.example @@ -0,0 +1,3 @@ +DB_NAME= +DB_USER= +DB_PASSWORD= \ No newline at end of file diff --git a/.gitignore b/.gitignore index 0481b84..ddf4317 100644 --- a/.gitignore +++ b/.gitignore @@ -33,8 +33,8 @@ test/ node_modules - - # Added by cargo - /target + +# .env +.env \ No newline at end of file diff --git a/dev-compose.yml b/dev-compose.yml new file mode 100644 index 0000000..575989e --- /dev/null +++ b/dev-compose.yml @@ -0,0 +1,27 @@ +services: + db: + image: postgres:latest + container_name: database + restart: unless-stopped + env_file: + - .env + volumes: + - postgres_data:/var/lib/postgresql/data + ports: + - "5432:5432" + environment: + POSTGRES_DB: ${DB_NAME} + POSTGRES_USER: ${DB_USER} + POSTGRES_PASSWORD: ${DB_PASSWORD} + + redis: + image: redis:latest + restart: unless-stopped + ports: + - '6379:6379' + volumes: + - redis:/data + +volumes: + postgres_data: + redis: