(For version 1, please visit here)
Demo (Test Account: 123456 / 123456)
Currently Not available
- Built on Docker -- One click Deployment
- Single Page Application -- Better User Experience
- Support multiple cases of test data
- Powered by Vue.js, Koa.js, MongoDB, Redis
Note: This project is still during BETA
stage
- clone this project
git clone https://github.com/acm309/PutongOJ.git PutongOJ
- compose up
docker-compose up
or
daemon mode
docker-compose up -d
It will listen on 80 ports after it is successfully deployed. Then you can directly visit this platform.
Enjoy it!
Ubuntu is recommended. You can deploy this platform on other linux, but I can't ensure it must work.
apt-get install libcairo2-dev libpango1.0-dev build-essential
- clone this repo
git clone https://github.com/acm309/PutongOJ.git
- install project dependencies
npm i -g pnpm
pnpm i
- setup database connections
export variables
export redisURL='your redis url'
export dbURL='your mongodb url'
update config/index.js
const prod = {
port: 3000 // the port the application will listen on
}
- setup static files and judger
node manager.js
pm2.config.json
would be generated.
- start
install pm2 first
npm i -g pm2
then start with pm2
pm2 start pm2.config.json
Know the Container Id
of the mongodb container by running:
docker ps
Replace <Container id>
with the real id of your running mongodb container
docker exec -it <Container id> mongodump --out /data/backup --db oj
The output data will be stored at migrations/backup/
docker exec -it <Container Id> mongorestore --db oj --drop /data/backup/oj
copy files to public
folder
Replace <Container id>
with the real id of your running oj container
docker cp <SRC_PATH> <Container Id>:/app/public
- IE: NOT recommended
- Chrome: 50 or above is recommended
- Firefox: 50 or above is recommended
- Edge: recommended