Skip to content

Commit

Permalink
Add docker compose config for postgres db
Browse files Browse the repository at this point in the history
  • Loading branch information
rashed091 committed Nov 21, 2023
1 parent 3b27118 commit d866ff1
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: "3.9"

services:
db:
image: postgres:latest
container_name: postgres
restart: always
user: postgres
secrets:
- db-password
volumes:
- db-data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=demo
- POSTGRES_PASSWORD_FILE=/run/secrets/db-password
expose:
- 5432
healthcheck:
test: [ "CMD", "pg_isready" ]
interval: 10s
timeout: 5s
retries: 5


volumes:
db-data:

secrets:
db-password:
file: db/pass.txt

0 comments on commit d866ff1

Please sign in to comment.