Skip to content

FOSTI-UMS/domjudge-fostifest-24

Repository files navigation

DOMjudge Setup with Docker Compose

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

Prerequisites

  • Docker

    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
  • Docker Compose for all user

    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"

Services Overview

  • db: MariaDB database service.
  • adminer: Adminer service for database management.
  • domserver: DOMjudge server service.
  • judgehost: DOMjudge judgehost service.

Setup Instructions

  1. Clone the Repository

    git clone https://github.com/FOSTI-UMS/domjudge-fostifest-24.git
    cd https://github.com/FOSTI-UMS/domjudge-fostifest-24.git
  2. Create .env File

    Create a .env file in the root of your project directory and fill in the necessary environment variables as shown in the Prerequisites section.

  3. Start Services

    docker compose up -d
    

    docker compose up -d

  4. Check initial domserver password

    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

    inital password use the initial password for login as admin username in http://localhost/login admin login

  5. Change Judgedaemon password on virtual environment .env

    .env

  6. Check judgehost status

    Visit http://localhost/jury/judgehosts on browser judgehost

  7. Restart Judgehost service

    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

  8. Check judgehost status

    Visit http://localhost/jury/judgehosts on browser

  9. Manage database

    Use Adminer by open your browser and go to http://localhost:8080. Login with MARIADB_USER and MARIADB_PASSWORD on .env file adminer

  10. login as demo user

    from http://localhost/login you can use this credentials to login

    USERNAME="demo"
    PASSWORD="demo"
    

    participants user

  11. Stop Services

    docker compose down
    

    delete with volume

    docker compose down -v
    

Configuration Details

  1. MariaDB (db)

    • Image: mariadb
    • Ports: Exposes port 3306 for MySQL connections.
    • Volumes: mariadb_data to persist database data.
  2. Adminer

    • Image: adminer
    • Ports: Exposes port 8080 for the Adminer web interface.
  3. DOMjudge Server (domserver)

    • Image: domjudge/domserver:${DOMJUDGE_VERSION}
    • Ports: Exposes port 80 for the DOMjudge web interface.
    • Volumes: domserver_data to persist DOMjudge configuration.
  4. Judgehost

    • 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.

Troubleshooting

docker compose logs <service-name>

change with service db, domjudge, judgehost, or adminer.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published