Skip to content

docker-compose file for SchOJ. [This would be useful if you want to install SchOJ/DMOJ.]

Notifications You must be signed in to change notification settings

kunguyenqt/dmoj-dockercompose

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DMOJ Docker

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

Installation

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

Usage

$ docker-compose up -d

Notes

Migrating

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

Managing Static Files

If your static files ever change, you will need to rebuild them:

$ ./scripts/copy_static

Updating The Site

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

About

docker-compose file for SchOJ. [This would be useful if you want to install SchOJ/DMOJ.]

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 75.0%
  • Dockerfile 16.4%
  • Shell 7.3%
  • JavaScript 1.3%