Quick Deployment with Docker Compose
Introduction
This section only describes how to quickly set up an SDUOJ. It's not recommended for long-term production use.
SDUOJ has not yet released its first stable version. For production purposes, the SDUOJ developers advise a wait-and-see attitude.
Prerequisites
Operating System
- Linux (Tested: Ubuntu 20.04, Ubuntu 22.04, Debian 10)
- macOS (Tested: Ventura 13.4.1)
Windows(Not Supported!)
Required Software
- git
- docker: Version
23.0.2
or higher - docker-compose-plugin: Version
2.17.2
or higher
You can verify using the following commands:
git version
docker -v
docker compose version
Installing Required Software (On Ubuntu/Debian Systems)
If you already have these installed, skip this step
- Using Mirror
- Without Mirror
export DOWNLOAD_URL="https://mirrors.cernet.edu.cn/docker-ce"
sudo apt-get update \
&& sudo apt-get install -qq -y curl git \
&& curl -fsSL https://get.docker.com/ | sudo -E sh
sudo apt-get update \
&& sudo apt-get install -qq -y curl git \
&& curl -fsSL https://get.docker.com/ | sudo -E sh
All-in-One Deployment (Pseudo-Distributed)
- Use a pay-as-you-go model to launch a cloud server with 16G or more memory from a cloud service provider.
- Install a Linux distribution on a virtual machine (Ubuntu 22.04 highly recommended).
If you just plan to simply deploy an SDUOJ to explore and try it out, follow these commands:
- Clone the
sduoj-deploy
project code
git clone https://github.com/SDUOJ/sduoj-deploy.git
- Enter the
sduoj-deploy
project directory
cd sduoj-deploy
- Execute
docker compose
(note it's notdocker-compose
) to start the orchestrated services
sudo docker compose up
- Access your server's IP through the URL, e.g.,
http://127.0.0.1:80/
- replace127.0.0.1
with your server's IP.
Initial account details are as follows; for security reasons, please change them:
- SDUOJ initial username and password are
superadmin
and123456
, respectively. Please change. - Nacos initial username and password are both
sduoj
. Please change. - MySQL initial username and password are both
sduoj
. Please change.
The ports for the database, message queue, and Nacos services are exposed. If deploying temporarily on a public cloud, consider setting up network security groups and expose only necessary ports like 22, 80, etc. Do the same on your physical server.