This README provides instructions on how to set up a DOMjudge environment for Competitive Programming using Docker Compose. This setup includes services for the database (MariaDB), DOMjudge server (domserver), Judgehost, and Adminer for database management. this readme also availabe in Bahasa
-
curl -fsSL https://get.docker.com -o get-docker.sh sudo sh ./get-docker.sh --dry-run
-
Docker Compose for current user
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} mkdir -p $DOCKER_CONFIG/cli-plugins curl -SL https://github.com/docker/compose/releases/download/v2.29.1/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose docker compose version
-
sudo mkdir -p /usr/local/lib/docker/cli-plugins sudo curl -SL https://github.com/docker/compose/releases/download/v2.29.1/docker-compose-linux-x86_64 -o /usr/local/lib/docker/cli-plugins/docker-compose sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
-
A
.env
file configured with the following variables (copy and configure from.env.example
file):DOMJUDGE_VERSION="latest" MARIADB_USER="user" MARIADB_PASSWORD="password" MARIADB_DATABASE="domjudge" MARIADB_ROOT_PASSWORD="password" JUDGEDAEMON_USERNAME="admin" JUDGEDAEMON_PASSWORD="some_random_password"
- db: MariaDB database service.
- adminer: Adminer service for database management.
- domserver: DOMjudge server service.
- judgehost: DOMjudge judgehost service.
-
git clone https://github.com/FOSTI-UMS/domjudge-fostifest-24.git cd https://github.com/FOSTI-UMS/domjudge-fostifest-24.git
-
Create a .env file in the root of your project directory and fill in the necessary environment variables as shown in the Prerequisites section.
-
docker compose up -d
-
run in your terminal (use sudo if your docker running for root user)
docker compose exec domserver cat /opt/domjudge/domserver/etc/initial_admin_password.secret
use the initial password for login as
admin
username in http://localhost/login -
Visit http://localhost/jury/judgehosts on browser
-
If you just see 1 judgehost ("example-judgehost1") maybe you need to restart your service. In your terminal run (use sudo if your docker running for root user)
docker compose down docker compose up -d
access http://localhost/jury/judgehost, if still inactive run this command
docker compose restart judgehost
in still inactive try troubleshooting
-
Visit http://localhost/jury/judgehosts on browser
-
Use Adminer by open your browser and go to http://localhost:8080. Login with
MARIADB_USER
andMARIADB_PASSWORD
on.env
file -
from http://localhost/login you can use this credentials to login
USERNAME="demo" PASSWORD="demo"
-
docker compose down
delete with volume
docker compose down -v
-
- Image: mariadb
- Ports: Exposes port 3306 for MySQL connections.
- Volumes: mariadb_data to persist database data.
-
- Image: adminer
- Ports: Exposes port 8080 for the Adminer web interface.
-
- Image: domjudge/domserver:${DOMJUDGE_VERSION}
- Ports: Exposes port 80 for the DOMjudge web interface.
- Volumes: domserver_data to persist DOMjudge configuration.
-
- Image: domjudge/judgehost:${DOMJUDGE_VERSION}
- Privileged Mode: Enabled to allow necessary permissions.
- Volumes:
- /sys/fs/cgroup for system control groups.
- judgehost_data to persist Judgehost data.
docker compose logs <service-name>
change with service db, domjudge, judgehost, or adminer.