-
-
Notifications
You must be signed in to change notification settings - Fork 5k
/
docker-compose.db-dev.yml
57 lines (49 loc) · 1.96 KB
/
docker-compose.db-dev.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
52
53
54
55
56
57
# For development this compose file starts the database only. The app can then
# be started using `yarn start-dev`, which is useful for development, because
# it means the app Docker file doesn't have to be rebuilt on each change.
#
# Note that log is setup to give as much information as possible, including
# whether it's the master or slave database that is being used for a query.
#
# To setup and test replication, use the following config in Joplin Server. Note
# in particular the different port, which means we access the slave and not the
# master.
#
# DB_USE_SLAVE=true
# SLAVE_POSTGRES_PASSWORD=joplin
# SLAVE_POSTGRES_DATABASE=joplin
# SLAVE_POSTGRES_USER=joplin
# SLAVE_POSTGRES_PORT=5433
# SLAVE_POSTGRES_HOST=localhost
version: '2'
services:
postgresql-master:
image: 'bitnami/postgresql:16.3.0'
ports:
- '5432:5432'
environment:
- POSTGRESQL_PASSWORD=joplin
- POSTGRESQL_USERNAME=joplin
- POSTGRESQL_DATABASE=joplin
- POSTGRESQL_REPLICATION_MODE=master
- POSTGRESQL_REPLICATION_USER=repl_user
- POSTGRESQL_REPLICATION_PASSWORD=repl_password
- POSTGRESQL_LOG_HOSTNAME=true
- POSTGRESQL_PGAUDIT_LOG=READ,WRITE
- POSTGRESQL_EXTRA_FLAGS=-c work_mem=100000 -c log_statement=all
postgresql-slave:
image: 'bitnami/postgresql:16.3.0'
ports:
- '5433:5432'
depends_on:
- postgresql-master
environment:
- POSTGRESQL_REPLICATION_MODE=slave
- POSTGRESQL_REPLICATION_USER=repl_user
- POSTGRESQL_REPLICATION_PASSWORD=repl_password
- POSTGRESQL_MASTER_HOST=postgresql-master
- POSTGRESQL_PASSWORD=joplin
- POSTGRESQL_MASTER_PORT_NUMBER=5432
- POSTGRESQL_LOG_HOSTNAME=true
- POSTGRESQL_PGAUDIT_LOG=READ,WRITE
- POSTGRESQL_EXTRA_FLAGS=-c work_mem=100000 -c log_statement=all