services: app: build: context: . dockerfile: Dockerfile ports: - "8081:80" environment: - DB_HOST=db - DB_NAME=license_tracker - DB_USER=root - DB_PASS=root_password depends_on: db: condition: service_healthy restart: always networks: - app-network db: build: context: . dockerfile: Dockerfile.db restart: always environment: - MYSQL_ROOT_PASSWORD=root_password - MYSQL_DATABASE=license_tracker # We remove the volume mount for the SQL script because it's now in the Dockerfile volumes: - db_data:/var/lib/mysql healthcheck: test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-proot_password"] interval: 5s timeout: 5s retries: 5 networks: - app-network networks: app-network: driver: bridge volumes: db_data: