-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.postgres.yml
47 lines (44 loc) · 1.13 KB
/
docker-compose.postgres.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# This docker compose is used for development purposes only
# Use the docker-compose.yml file in the root of the project for an example
version: '3.9'
services:
postgres_db:
image: postgres:14
restart: unless-stopped
container_name: postgres_db
volumes:
- ./postgres/db:/var/lib/postgresql/data
environment:
- POSTGRES_DB=mydatabase
- POSTGRES_USER=myuser
- POSTGRES_PASSWORD=${DUMPER_PASSWORD}
networks:
- db
database_dumper_postgres:
build:
context: .
dockerfile: Dockerfile
target: postgres-14
restart: unless-stopped
#command: tail -f /dev/null
#command: /dump.sh
depends_on:
- postgres_db
container_name: database_dumper_postgres
volumes:
- ./postgres/dumps:/dumps
environment:
- PGID=1000
- PUID=1000
- DUMPER_DATABASE=mydatabase
- DUMPER_HOST=postgres_db
- DUMPER_USER=myuser
- DUMPER_PASSWORD=${DUMPER_PASSWORD}
- DUMPER_KEEP=2
- DUMPER_SCHEDULE=* * * * *
- DUMPER_HEALTHCHECKS_URL=${DUMPER_HEALTHCHECKS_URL}
networks:
- db
networks:
db:
driver: bridge