-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
30 lines (29 loc) · 1.01 KB
/
Copy pathdocker-compose.yml
File metadata and controls
30 lines (29 loc) · 1.01 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
services:
# MySQL database service definition
db:
image: mysql:8.0
# Match the container name used locally so `docker start mysql-db` works.
container_name: mysql-db
# Auto-start on boot / Docker daemon restart, but honor a manual `docker stop`
# so you never have to run `docker start mysql-db` by hand again.
restart: unless-stopped
environment:
# Set the root password (matches our default .env configuration)
MYSQL_ROOT_PASSWORD: mysql
# Pre-create the database 'vibe_db' on startup
MYSQL_DATABASE: vibe_db
ports:
# Map container port 3306 to host port 3306
- '3306:3306'
volumes:
# Persist MySQL data using a named volume
- mysql_data:/var/lib/mysql
# Report readiness so dependents can wait for an accepting MySQL.
healthcheck:
test: ['CMD', 'mysqladmin', 'ping', '-h', 'localhost', '-pmysql']
interval: 10s
timeout: 5s
retries: 5
volumes:
# Named volume for persistent database storage
mysql_data: