Skip to content

Commit 3582511

Browse files
✨feature : add demo postgres database with Docker and URL inside .env.example
1 parent 5a9e8b9 commit 3582511

2 files changed

Lines changed: 27 additions & 3 deletions

File tree

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
#
1717
# You can define multiple database connections below.
1818

19+
# Docker Demo Database
20+
DATABASE_URL=postgresql://postgres:password@localhost:5432/db_handler_demo
21+
1922
# Production Database
2023
DATABASE_URL=postgresql://user:password@localhost:5432/prod_db
2124

compose.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,34 @@ services:
33
image: oven/bun:latest
44
command: bash
55
volumes:
6-
- .:${PWD}
7-
working_dir: ${PWD}
6+
- .:/app
7+
- /app/node_modules
8+
working_dir: /app
89
environment:
910
- TZ=Europe/Paris
1011
- LOG_LEVEL=trace
1112
env_file:
1213
- .env
1314
tty: true
1415
init: true
15-
16+
depends_on:
17+
postgres:
18+
condition: service_healthy
19+
20+
postgres:
21+
image: postgres:17-alpine
22+
restart: always
23+
environment:
24+
POSTGRES_USER: postgres
25+
POSTGRES_PASSWORD: password
26+
POSTGRES_DB: db_handler_demo
27+
volumes:
28+
- pg_data:/var/lib/postgresql/data
29+
healthcheck:
30+
test: ["CMD-SHELL", "pg_isready -U postgres"]
31+
interval: 5s
32+
timeout: 5s
33+
retries: 5
34+
35+
volumes:
36+
pg_data:

0 commit comments

Comments
 (0)