This repository contains the Docker files to run a clone of the VNOI base on DMOJ site. It configures some additional services, such as mathoid and texoid.
This is using some scritps and config from Ninjaclasher
First, Docker and Docker Compose must be installed. Installation instructions can be found on their respective websites.
Clone the repository:
$ git clone https://github.com/kunguyenqt/dmoj-dockercompose
$ cd dmoj-dockercompose
$ git submodule update --init --recursive
Configure the environment variables in the files in env/site.env
, env/judge1.env
, env/mysql.env
. In particular. Also, configure the server_name
directive in site/nginx.conf
.
Next, build the images:
$ docker-compose build
Start up the site, so you can perform the initial migrations and generate the static files:
$ docker-compose up -d site
You will need to generate the schema for the database, since it is currently empty:
$ ./scripts/migrate
You will also need to generate the static files:
$ ./scripts/copy_static
Finally, the DMOJ comes with fixtures so that the initial install is not blank. They can be loaded with the following commands:
$ ./scripts/manage.py loaddata navbar
$ ./scripts/manage.py loaddata language_small
$ ./scripts/manage.py loaddata demo
$ docker-compose up -d
As the DMOJ site is a Django app, you may need to migrate whenever you update. Assuming the site container is running, running the following command should suffice:
$ ./scripts/migrate
If your static files ever change, you will need to rebuild them:
$ ./scripts/copy_static
Updating various sections of the site requires different images to be rebuilt.
If any prerequisites were modified, you will need to rebuild most of the images:
$ docker-compose up -d --build site
If the static files are modified, read the section on Managing Static Files.
If only the source code is modified, a restart is sufficient:
$ docker-compose restart site