Docker Deployment Config of Hydro-OJ
There are two ways to deploy the services. We highly recommend using the prebuilt Docker image if you have a server with an amd64 architecture.
Before you start, make sure you have Docker with Docker Compose installed.
-
Download the example compose file (prebuilt version) and name it
docker-compose.ymlwget -c "https://raw.githubusercontent.com/TGU-CSDN/Hydro-Docker/main/docker-compose-prebuilt-full.yml" -O docker-compose.ymlFor users in China, you may encounter network problems when accessing ghcr.io. To solve this problem, we have prepared a compose file with mirrored acceleration. You can replace the above command with the following one:
wget -c "https://raw.githubusercontent.com/TGU-CSDN/Hydro-Docker/main/docker-compose-prebuilt-full-china-mirrored.yml" -O docker-compose.yml -
Start containers
sudo docker compose up -d
-
Clone this repository
-
Start containers
sudo docker compose up -d
For Chinese users, you can use the compose file with mirror already set.
sudo docker compose -f docker-compose-build-with-mirror.yml up -d
After the deployment, all containers should be created and running. You can simply run the command sudo docker compose ps to check it.
By default, the port 80 is listened. You can visit the system by opening http://localhost.
After containers start, there should be a folder named data located at the same level directory as your compose file.
The first installation will create a super admin user with the username root and password rootroot. You MUST change the password either through the Web UI or Hydro CLI.
After changing the password, you MUST update the config file at ./data/judge/judge.yaml with the new password. Then you should restart the judge service:
sudo docker compose restart oj-judge