Repository navigation
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
127 lines (120 loc) · 4.03 KB
/
Copy pathdocker-compose.test.yml
File metadata and controls
127 lines (120 loc) · 4.03 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
services:
postgres16:
image: postgres:16
environment:
POSTGRES_PASSWORD: rootpass
POSTGRES_DB: app_prod
ports:
- "127.0.0.1:55416:5432"
configs:
- source: postgres16_init
target: /docker-entrypoint-initdb.d/init.sql
mode: 0444
postgres17:
image: postgres:17
environment:
POSTGRES_PASSWORD: rootpass
POSTGRES_DB: app_prod
ports:
- "127.0.0.1:55417:5432"
configs:
- source: postgres17_init
target: /docker-entrypoint-initdb.d/init.sql
mode: 0444
postgres18:
image: postgres:18
environment:
POSTGRES_PASSWORD: rootpass
POSTGRES_DB: app_prod
ports:
- "127.0.0.1:55418:5432"
configs:
- source: postgres18_init
target: /docker-entrypoint-initdb.d/init.sql
mode: 0444
postgres13:
image: postgres:13
environment:
POSTGRES_PASSWORD: rootpass
POSTGRES_DB: app_prod
ports:
- "127.0.0.1:55413:5432"
configs:
- source: postgres13_init
target: /docker-entrypoint-initdb.d/init.sql
mode: 0444
mysql8:
image: mysql:8.0
command: ["--gtid-mode=ON", "--enforce-gtid-consistency=ON"]
environment:
MYSQL_ROOT_PASSWORD: rootpass
MYSQL_DATABASE: app_prod
ports:
- "127.0.0.1:53380:3306"
configs:
- source: mysql8_init
target: /docker-entrypoint-initdb.d/init.sql
mode: 0444
mariadb:
image: mariadb:10.11
environment:
MARIADB_ROOT_PASSWORD: rootpass
MARIADB_DATABASE: app_prod
ports:
- "127.0.0.1:53310:3306"
configs:
- source: mariadb_init
target: /docker-entrypoint-initdb.d/init.sql
mode: 0444
sftp:
image: atmoz/sftp:alpine
command: ["dbak::1001:1001:upload"]
ports:
- "127.0.0.1:52222:22"
configs:
- source: sftp_key
target: /home/dbak/.ssh/keys/id_ed25519.pub
mode: 0444
configs:
postgres16_init: &postgres_modern_init
content: |
CREATE ROLE backup_ro WITH LOGIN PASSWORD 'Te:st\pa"ss#1';
GRANT pg_read_all_data TO backup_ro;
CREATE TABLE customers (id serial PRIMARY KEY, name text NOT NULL);
INSERT INTO customers (name) SELECT 'customer ' || g FROM generate_series(1, 1000) AS g;
postgres17_init: *postgres_modern_init
postgres18_init: *postgres_modern_init
postgres13_init:
content: |
CREATE ROLE backup_ro WITH LOGIN PASSWORD 'Te:st\pa"ss#1';
CREATE TABLE customers (id serial PRIMARY KEY, name text NOT NULL);
INSERT INTO customers (name) SELECT 'customer ' || g FROM generate_series(1, 1000) AS g;
GRANT CONNECT ON DATABASE app_prod TO backup_ro;
GRANT USAGE ON SCHEMA public TO backup_ro;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO backup_ro;
GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO backup_ro;
CREATE DATABASE app_restricted;
\c app_restricted
CREATE TABLE open_table (id int);
GRANT USAGE ON SCHEMA public TO backup_ro;
GRANT SELECT ON open_table TO backup_ro;
CREATE TABLE audit_log (id int);
mysql8_init:
content: |
CREATE USER 'backup_ro'@'%' IDENTIFIED BY 'Te:st\\pa"ss#1';
GRANT SELECT, SHOW VIEW, TRIGGER, LOCK TABLES, EVENT ON `app_prod`.* TO 'backup_ro'@'%';
GRANT SHOW_ROUTINE ON *.* TO 'backup_ro'@'%';
USE app_prod;
CREATE TABLE customers (id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100) NOT NULL);
INSERT INTO customers (name) VALUES ('alpha'), ('beta'), ('gamma');
mariadb_init:
content: |
CREATE USER 'backup_ro'@'%' IDENTIFIED BY 'Te:st\\pa"ss#1';
GRANT SELECT, SHOW VIEW, TRIGGER, LOCK TABLES, EVENT ON `app_prod`.* TO 'backup_ro'@'%';
GRANT SELECT ON `mysql`.`proc` TO 'backup_ro'@'%';
USE app_prod;
CREATE TABLE customers (id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100) NOT NULL);
INSERT INTO customers (name) VALUES ('alpha'), ('beta'), ('gamma');
sftp_key:
content: |
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBqhB+k60M+wEDfNcU5IHZbRuHByOg3/NLF09f+fdYM5 dbak-integration-test