Simplify docker-compose: app only, DB is external
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,29 +1,7 @@
|
||||
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:
|
||||
build: .
|
||||
ports:
|
||||
- "8720:8720"
|
||||
env_file: .env
|
||||
environment:
|
||||
MYSQL_HOST: db # override localhost → compose service name
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
mysql_data:
|
||||
|
||||
Reference in New Issue
Block a user