# Optional overlay: seed the database with a mysqldump instead of starting # from the empty schema shipped in ./db/app_uoj233.sql. # # docker compose -f docker-compose.yml -f docker-compose.seed.yml up -d --build # # IMPORTANT # * Init scripts only run when the mysql datadir is empty. To re-seed: # docker compose down # rm -rf ./uoj_data/db/mysql # docker compose -f docker-compose.yml -f docker-compose.seed.yml up -d # * The dump contains real user data (emails, QQ numbers, password hashes, # private messages). It is gitignored on purpose -- do not commit it, and # think twice before putting a seeded instance on a public network. # * The dump's own DROP/CREATE statements replace the schema from # 001-app_uoj233.sql, which also wipes the judger row inserted by # 002-add_judger.sql -- hence the extra 004 mount below. # * Adjust the source path if your dump has another name. version: '3' services: uoj-db: volumes: - ./wyoj-0924.sql:/docker-entrypoint-initdb.d/003-wyoj-0924.sql:ro - ./db/add_judger.sql:/docker-entrypoint-initdb.d/004-add_judger.sql:ro