docker-compose.seed.yml 1.1 KB

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