-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.mysql-config.yml
More file actions
120 lines (111 loc) · 2.87 KB
/
docker-compose.mysql-config.yml
File metadata and controls
120 lines (111 loc) · 2.87 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
version: '3.8'
services:
# Configuration MySQL database
config-mysql:
image: mysql:8.0
container_name: gosqlguard-config-mysql
restart: unless-stopped
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_ROOT_PASSWORD: config_root_password
MYSQL_DATABASE: gosqlguard_config
MYSQL_USER: gosqlguard
MYSQL_PASSWORD: config_password
ports:
- "3308:3306" # Different port to avoid conflicts
volumes:
- config_mysql_data:/var/lib/mysql
- ./deployments/mysql-sidecar/init:/docker-entrypoint-initdb.d:ro
networks:
- gosqlguard_network
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 5s
timeout: 5s
retries: 5
# GoSQLGuard with MySQL configuration
gosqlguard-mysql-config:
build:
context: .
dockerfile: Dockerfile
container_name: gosqlguard-controller-mysql
restart: unless-stopped
depends_on:
config-mysql:
condition: service_healthy
mysql-service:
condition: service_healthy
postgres-service:
condition: service_healthy
minio-setup:
condition: service_completed_successfully
environment:
DEBUG: "true"
CONFIG_SOURCE: "mysql"
CONFIG_MYSQL_HOST: config-mysql
CONFIG_MYSQL_PORT: "3306"
CONFIG_MYSQL_DATABASE: gosqlguard_config
CONFIG_MYSQL_USER: gosqlguard
CONFIG_MYSQL_PASSWORD: config_password
volumes:
- gosqlguard_backups:/backups
- gosqlguard_metadata:/app/metadata
ports:
- "8889:8080" # Different port for this instance
networks:
- gosqlguard_network
# MySQL Service (target for backups)
mysql-service:
extends:
file: docker-compose.yml
service: mysql-service
networks:
- gosqlguard_network
# PostgreSQL Service (target for backups)
postgres-service:
extends:
file: docker-compose.yml
service: postgres-service
networks:
- gosqlguard_network
# MinIO (S3-compatible storage)
minio:
extends:
file: docker-compose.yml
service: minio
networks:
- gosqlguard_network
# MinIO setup
minio-setup:
extends:
file: docker-compose.yml
service: minio-setup
networks:
- gosqlguard_network
# Configuration management UI (optional)
config-ui:
image: phpmyadmin:latest
container_name: gosqlguard-config-ui
restart: unless-stopped
depends_on:
config-mysql:
condition: service_healthy
environment:
PMA_HOST: config-mysql
PMA_USER: gosqlguard
PMA_PASSWORD: config_password
PMA_ARBITRARY: 0
ports:
- "8890:80"
networks:
- gosqlguard_network
volumes:
config_mysql_data:
mysql_data:
postgres_data:
minio_data:
gosqlguard_backups:
gosqlguard_metadata:
networks:
gosqlguard_network:
driver: bridge