-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdocker-compose.yml
51 lines (49 loc) · 1.57 KB
/
docker-compose.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
48
49
50
51
services:
# See https://hub.docker.com/_/postgres/ for details of the postgres image.
# POSTGRES_PASSWORD - superuser password for PostgreSQL
# POSTGRES_USER - superuser (default is 'postgres')
# POSTGRES_DB - name of default database (default is value of POSTGRES_USER)
db:
image: postgres:14.11-alpine3.19
volumes:
- ./application:/data
ports:
- "5432"
environment:
POSTGRES_PASSWORD: r00tp@ss!
# DB_HOST - hostname of the database server
# DB_ROOTUSER - administrative user for the database server
# DB_ROOTPASSWORD - password for the DB_ROOTUSER
# DB_USER - user that accesses the database
# DB_USERPASSWORD - password for the DB_USER
# DB_NAME - name of database to back up/restore
restore:
build: ./
volumes:
- ./application:/data
env_file:
- ./local.env
environment:
DB_HOST: db
DB_ROOTUSER: postgres
DB_ROOTPASSWORD: r00tp@ss!
DB_USER: dbuser
DB_USERPASSWORD: dbuserpass
DB_NAME: world
MODE: restore
CRON_SCHEDULE: "25 * * * *"
backup:
build: ./
volumes:
- ./application:/data
env_file:
- ./local.env
environment:
DB_HOST: db
DB_ROOTUSER: postgres
DB_ROOTPASSWORD: r00tp@ss!
DB_USER: dbuser
DB_USERPASSWORD: dbuserpass
DB_NAME: world
MODE: backup
CRON_SCHEDULE: "20 * * * *"