34 lines
795 B
YAML
34 lines
795 B
YAML
services:
|
|
app:
|
|
build: .
|
|
ports:
|
|
- "8080:80"
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
environment:
|
|
DB_HOST: db
|
|
volumes:
|
|
- .:/var/www/html
|
|
restart: unless-stopped
|
|
|
|
db:
|
|
image: mysql:8.0
|
|
restart: unless-stopped
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: rootpassword
|
|
# sig-01, sig-02, sig-03 databases are all created via init SQL below
|
|
volumes:
|
|
- db_data:/var/lib/mysql
|
|
- ./database/init.sql:/docker-entrypoint-initdb.d/init.sql
|
|
healthcheck:
|
|
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-prootpassword"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
ports:
|
|
- "3306:3306" # optional: expose for local tools like TablePlus/DBeaver
|
|
|
|
volumes:
|
|
db_data:
|