Last active
October 2, 2024 08:01
-
-
Save SethDusek/486cc6167e43c957ef6c115005fa1008 to your computer and use it in GitHub Desktop.
Docker compose.yaml file for Domjudge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Domjudge compose.yaml. To run: | |
# First add the following to /etc/default/grub's GRUB_CMDLINE_LINUX_DEFAULT section: | |
# cgroup_enable=memory swapaccount=1 systemd.unified_cgroup_hierarchy=0 | |
# $ head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13 > db_password.txt | |
# $ head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13 > db_root_password.txt | |
# $ docker compose up | |
# Note that judgehosts will not work the first time you run 'docker compose up'. After initial setup is completed it will print the following in logs: | |
# domjudge-1 | Initial admin password is mmBEWPj2VYWYiW_v | |
# domjudge-1 | | |
# domjudge-1 | Initial judgehost password is uBCdPeZFf+N2LBqylYVpMvaFBoaXTsdC | |
# Copy this password and put it in judgehost_password.txt. Example: | |
# echo "uBCdPeZF..." > judgehost_password.txt | |
# Run docker compose again: | |
# $ docker compose up | |
# To create more judgehost instances, copy paste the judgehost section and increment DAEMON_ID | |
services: | |
mysql: | |
image: mysql:latest | |
ports: | |
- 13306:3306 | |
environment: | |
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/db_root_password | |
MYSQL_DATABASE: domjudge | |
MYSQL_USER: domjudge | |
MYSQL_PASSWORD_FILE: /run/secrets/db_password | |
volumes: | |
- db_data:/var/lib/mysql | |
secrets: | |
- db_root_password | |
- db_password | |
domjudge: | |
depends_on: | |
- mysql | |
image: domjudge/domserver:latest | |
volumes: | |
- domjudge_data:/opt/domjudge/ | |
ports: | |
- 80:80 | |
environment: | |
MYSQL_USER: domjudge | |
MYSQL_PASSWORD_FILE: /run/secrets/db_password | |
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/db_root_password | |
MYSQL_HOST: mysql | |
MYSQL_DATABASE: domjudge | |
secrets: | |
- db_password | |
- db_root_password | |
- judgehost_password | |
judgehost: | |
privileged: true | |
restart: always | |
volumes: | |
- /sys/fs/cgroup:/sys/fs/cgroup:ro | |
depends_on: | |
- domjudge | |
image: domjudge/judgehost:latest | |
environment: | |
DAEMON_ID: 0 | |
DOMSERVER_BASEURL: http://domjudge/ | |
JUDGEDAEMON_PASSWORD_FILE: /run/secrets/judgehost_password | |
secrets: | |
- judgehost_password | |
secrets: | |
db_password: | |
file: db_password.txt | |
db_root_password: | |
file: db_root_password.txt | |
# Judgehost password. When starting using 'docker compose up' for the first time, you will have to copy the judgedaemon/judgehost password from there and put it into judgehost_password.txt | |
# I'm not aware of a way to automate this, might be possible by modifying domjudge Docker.yml | |
judgehost_password: | |
file: judgehost_password.txt | |
volumes: | |
db_data: | |
domjudge_data: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment