-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
195 lines (185 loc) · 7.17 KB
/
Copy pathdocker-compose.yml
File metadata and controls
195 lines (185 loc) · 7.17 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# FoxSchema — test databases for all 6 server-based providers.
# SQLite needs no container — seed files are in docker/init/sqlite/.
#
# First start: docker compose up -d (auto-seeds demo_a / demo_b schemas)
# Stop: docker compose down
# Logs: docker compose logs -f <service>
# Full reset: docker compose down -v && docker compose up -d
#
# Init scripts only run once (when the data volume is empty).
# After a full reset they re-run automatically — no manual seeding needed.
#
# Apple Silicon: DB2 requires Rosetta — enable in Docker Desktop → Settings →
# "Use Rosetta for x86/amd64 emulation on Apple Silicon".
services:
# ── PostgreSQL 16 ───────────────────────────────────────────────────────────
postgres:
image: postgres:16
container_name: foxschema-postgres
environment:
POSTGRES_USER: foxuser
POSTGRES_PASSWORD: foxpass
POSTGRES_DB: foxdb
ports:
- "5432:5432"
volumes:
- pg_data:/var/lib/postgresql/data
- ./docker/init/postgres:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U foxuser -d foxdb"]
interval: 5s
timeout: 5s
retries: 10
# ── MySQL 8 ─────────────────────────────────────────────────────────────────
mysql:
image: mysql:8
container_name: foxschema-mysql
environment:
MYSQL_ROOT_PASSWORD: foxrootpass
MYSQL_USER: foxuser
MYSQL_PASSWORD: foxpass
MYSQL_DATABASE: foxdb
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
- ./docker/init/mysql:/docker-entrypoint-initdb.d:ro
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "foxuser", "-pfoxpass"]
interval: 5s
timeout: 5s
retries: 12
# ── MariaDB 11 ──────────────────────────────────────────────────────────────
mariadb:
image: mariadb:11
container_name: foxschema-mariadb
environment:
MARIADB_ROOT_PASSWORD: foxrootpass
MARIADB_USER: foxuser
MARIADB_PASSWORD: foxpass
MARIADB_DATABASE: foxdb
ports:
- "3307:3306"
volumes:
- mariadb_data:/var/lib/mysql
- ./docker/init/mariadb:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
interval: 5s
timeout: 5s
retries: 12
# ── SQL Server 2022 ─────────────────────────────────────────────────────────
# Uses a custom entrypoint that starts sqlservr, waits for it to be ready,
# seeds the demo schemas once, then keeps the process running.
sqlserver:
image: mcr.microsoft.com/mssql/server:2022-latest
container_name: foxschema-sqlserver
user: root
environment:
ACCEPT_EULA: "Y"
MSSQL_SA_PASSWORD: "FoxPass123!"
ports:
- "1433:1433"
volumes:
- sqlserver_data:/var/opt/mssql
- ./docker/init/sqlserver:/docker-init:ro
entrypoint: ["/bin/bash", "/docker-init/entrypoint.sh"]
healthcheck:
test: ["CMD-SHELL", "/opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P 'FoxPass123!' -Q 'SELECT 1' -No -C || exit 1"]
interval: 10s
timeout: 5s
retries: 10
# ── Oracle Free 23c (ARM64-native) ──────────────────────────────────────────
# Init scripts in /container-entrypoint-initdb.d run after the DB is ready.
# 01_seed.sh connects as SYSTEM to create demo_a / demo_b users and objects.
oracle:
image: gvenzl/oracle-free:23-slim
container_name: foxschema-oracle
environment:
ORACLE_PASSWORD: FoxPass123
ORACLE_DATABASE: FOXDB
APP_USER: foxuser
APP_USER_PASSWORD: foxpass
ports:
- "1521:1521"
volumes:
- oracle_data:/opt/oracle/oradata
- ./docker/init/oracle:/container-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD-SHELL", "healthcheck.sh"]
interval: 10s
timeout: 10s
retries: 20
start_period: 60s
# ── IBM DB2 Community Edition (x86 only — runs via Rosetta on Apple Silicon) ─
db2:
image: icr.io/db2_community/db2
platform: linux/amd64
container_name: foxschema-db2
privileged: true
environment:
LICENSE: accept
DB2INST1_PASSWORD: foxpass
DBNAME: foxdb
ports:
- "50000:50000"
volumes:
- db2_data:/database
# The community image auto-execs every file directly under /var/custom
# (not docker-entrypoint-initdb.d like Postgres/MySQL) — only the wrapper
# script goes there. The .sql it runs is mounted at a separate path so the
# "run every file in this dir" loop doesn't also try to exec the SQL file.
- ./docker/init/db2/01_seed.sh:/var/custom/01_seed.sh:ro
- ./docker/init/db2/01_seed.sql:/var/custom-sql/01_seed.sql:ro
healthcheck:
test: ["CMD-SHELL", "su - db2inst1 -c 'db2 connect to foxdb' | grep -q 'Database Connection Information'"]
interval: 15s
timeout: 15s
retries: 20
start_period: 120s
# ── CockroachDB (PostgreSQL wire-compatible, distributed SQL) ────────────────
# No docker-entrypoint-initdb.d — seeded via scripts/seed/seed-all.sh (which
# execs `cockroach sql` into the running node). Uses a trigger-free seed
# (docker/init/cockroachdb/01_seed.sql) since CockroachDB has no triggers.
cockroachdb:
image: cockroachdb/cockroach:latest
container_name: foxschema-cockroachdb
command: start-single-node --insecure
ports:
- "26257:26257"
volumes:
- cockroach_data:/cockroach/cockroach-data
healthcheck:
test: ["CMD-SHELL", "cockroach sql --insecure -e 'SELECT 1' >/dev/null 2>&1 || exit 1"]
interval: 5s
timeout: 5s
retries: 20
# ── YugabyteDB (PostgreSQL-compatible distributed SQL; YSQL on 5433) ─────────
# YSQL reuses the Postgres query layer, so it seeds from the SAME Postgres seed
# (docker/init/postgres/01_seed.sql) via seed-all.sh. YSQL binds the node's
# address, so the healthcheck/seed connect via `hostname -i`, not localhost.
yugabytedb:
image: yugabytedb/yugabyte:latest
container_name: foxschema-yugabytedb
command: bin/yugabyted start --background=false
ports:
- "5433:5433"
- "15433:15433"
volumes:
- yugabyte_data:/root/var
healthcheck:
test: ["CMD-SHELL", "bin/ysqlsh -h $$(hostname -i) -p 5433 -U yugabyte -c 'SELECT 1' >/dev/null 2>&1 || exit 1"]
interval: 10s
timeout: 10s
retries: 30
start_period: 60s
volumes:
pg_data:
mysql_data:
mariadb_data:
sqlserver_data:
oracle_data:
db2_data:
cockroach_data:
yugabyte_data: