fix: bake schema.sql into db image to fix Coolify bind mount error
Bind mount ./schema.sql created a directory instead of file in Coolify, causing MySQL batch_readline error. Use Dockerfile.db to COPY schema directly into the image instead. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
FROM mysql:8.0
|
||||
COPY schema.sql /docker-entrypoint-initdb.d/schema.sql
|
||||
+3
-2
@@ -24,7 +24,9 @@ services:
|
||||
start_period: 30s
|
||||
|
||||
db:
|
||||
image: mysql:8.0
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.db
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
MYSQL_DATABASE: "${DB_NAME:-webgis_jalan}"
|
||||
@@ -33,7 +35,6 @@ services:
|
||||
MYSQL_ROOT_PASSWORD: "${DB_ROOT_PASSWORD:?Set DB_ROOT_PASSWORD in Coolify}"
|
||||
volumes:
|
||||
- mysql-data:/var/lib/mysql
|
||||
- ./schema.sql:/docker-entrypoint-initdb.d/schema.sql:ro
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "mysqladmin ping -h localhost -uroot -p\"$${MYSQL_ROOT_PASSWORD}\" --silent"]
|
||||
interval: 5s
|
||||
|
||||
Reference in New Issue
Block a user