mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
Docker Compose Database Setup (#379)
Co-authored-by: Aman Varshney <amanvarshney.work@gmail.com>
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
name: {{projectName}}
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres
|
||||
container_name: {{projectName}}-postgres
|
||||
environment:
|
||||
POSTGRES_DB: {{projectName}}
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: password
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- {{projectName}}_postgres_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
{{projectName}}_postgres_data:
|
||||
Reference in New Issue
Block a user