Applies prisma/migrations/*/migration.sql on first container boot via a sourced docker-entrypoint-initdb.d script, so a fresh container matches a `prisma migrate deploy` run without needing shadow-database privileges. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
29 lines
907 B
YAML
29 lines
907 B
YAML
services:
|
|
mariadb:
|
|
image: mariadb:lts
|
|
container_name: convert_mariadb
|
|
restart: unless-stopped
|
|
# Credentials below match .env.local (DB_HOST=127.0.0.1, DB_USER, DB_PASSWORD, DB_NAME).
|
|
# Update both files together if you change any of these.
|
|
environment:
|
|
MARIADB_ROOT_PASSWORD: root_change_me
|
|
MARIADB_DATABASE: file_converter
|
|
MARIADB_USER: convert_user
|
|
MARIADB_PASSWORD: change_me
|
|
ports:
|
|
- "3306:3306"
|
|
volumes:
|
|
- mariadb_data:/var/lib/mysql
|
|
# Raw SQL from prisma/migrations, applied on first boot by the init script below.
|
|
- ./prisma/migrations:/prisma-migrations:ro
|
|
- ./docker/mariadb-initdb:/docker-entrypoint-initdb.d:ro
|
|
healthcheck:
|
|
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
|
|
start_period: 10s
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
volumes:
|
|
mariadb_data:
|