Simplify docker-compose: app only, DB is external

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Martin Hohenberg
2026-06-18 19:22:48 +02:00
parent f66af4c732
commit 16a13293cf

View File

@@ -1,29 +1,7 @@
services: services:
db:
image: mysql:8.2
restart: unless-stopped
env_file: .env
volumes:
- mysql_data:/var/lib/mysql
- ./db.sql:/docker-entrypoint-initdb.d/01_schema.sql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "--silent"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
app: app:
build: . build: .
ports: ports:
- "8720:8720" - "8720:8720"
env_file: .env env_file: .env
environment:
MYSQL_HOST: db # override localhost → compose service name
depends_on:
db:
condition: service_healthy
restart: unless-stopped restart: unless-stopped
volumes:
mysql_data: