ECSS Infrastructure
A meta repository storing config files for the running of all ECSS related services on our VM.
Why?
The main reason for this repository is to version control our docker-compose.yaml file. This file is what is
responsible for the majority of our infrastructure and this respository allows us to version control
that infrastructure. It is our attempt at IaC (Infrastructure as Code)
What does this repo contain
- Infrastructure configuration
- Configs for services that we run
- Environment variables for docker compose services
- Secrets
- A script to update the infrastructure
- install.sh - Script to install the infrastructure from scratch
- update.sh - Script to pull the latest changes and restart the infrastructure
- prune.sh - Script to prune various docker objects (containers, images, volumes) (daily crontab)
- backup-env.sh - Script to backup the env files (daily crontab)
- restore-env.sh - Script to restore the env files
- backup-db.sh - Script to backup the mongodb database (daily crontab)
- restore-db.sh - Script to restore the mongodb database
- delete-old.sh - Script to delete backups older than 30 days (daily crontab)
How to use
Prerequisites
Running the infrastructure
- Clone the repository
git clone https://github.com/ecss-soton/infrastructure.git && cd infrastructure
- Copy the example env files and fill them in with the production values
cp env/web_main.env.example env/web_main.env && cp env/web_sotonverify.env.example env/web_sotonverify.env && cp env/web_teamreg.env.example env/web_teamreg.env && cp env/bot_sotonverify.env.example env/bot_sotonverify.env
- Configure the Caddyfile
You'll want to change our FQDN (society.ecs.soton.ac.uk + sotonverify.link) to your own.
- Run the infrastructure
docker compose up -d
Updating the infrastructure
- Run the update script
chmod +x scripts/update.sh && ./scripts/update.sh
Domains
Both websites redirect www. to the non-www version