Multipurpose Online Coding Assessment Platform (MOCAP) is a web-based platform that aims to eliminate the need for students to individually configure their coding environments when completing course coding assignments.
To complete course coding assignments, students need to set up a coding environment on their local machines. However, issues might arise when setting up the environment due to discrepancies in libraries, dependencies, operating systems, and hardware. These differences can lead to problems when running assignments in markers' environments, resulting in disputes between students and teachers.
To address this problem, MOCAP provides a solution by hosting a web platform that offers a customizable coding environment using Docker. Docker ensures environment consistency and replicability, thereby eliminating the problems arising from discrepancies in libraries, dependencies, and operating systems.
mocap-docker-compose is a docker compose repository for creating frontend, backend, Keycloak, database, and NGINX for MOCAP.
-
Clone all the repositories. Your folder structure should be like this.
./ ├── mocap-frontend/ │ ├── ... │ └── compose.yaml ├── mocap-backend/ │ ├── ... │ └── compose.yaml ├── mocap-keycloak/ │ ├── ... │ └── compose.yaml └── mocap-docker-compose
-
Fill in all the
.env.production.local
in all the repositories respectively. -
Make sure all the repositories are up to date by running:
chmod +x git-pull.sh ./git-pull.sh
-
In
mocap-docker-compose
, create a copy of.env.production
and rename it as.env.production.local
. -
Fill in all required environment variables.
-
Build the docker image.
docker-compose build
-
Create a docker network
mocap
if you haven't already.docker network create mocap
-
Start the container.
docker-compose up
Let’s Encrypt is used for HTTPS connection.
-
Install certbot
sudo apt install certbot
-
Obtain the TLS/SSL certificate from the Let’s Encrypt
sudo certbot certonly -d <domain1> -d <domain2>
-
Copy The TSL/SSL Certificates
sudo mkdir -p /etc/letsencrypt/ssl sudo cp -r -L /etc/letsencrypt/live/<domain>/fullchain.pem /etc/letsencrypt/ssl/ sudo cp -r -L /etc/letsencrypt/live/<domain>/privkey.pem /etc/letsencrypt/ssl/
```bash
docker exec -t mocap-database pg_dump mocap -U admin > dump_`date +%Y-%m-%d"_"%H_%M_%S`.sql
```
and then sftp to download it.
```bash
cat <backup_file> | docker exec -i mocap-database psql mocap -U admin
```
-
Please fork this repository and create a pull request if you want to contribute.
-
Please follow conventional commits when you commit!