Skip to main content

Current Production Deployment (GCP Runtime)

This page describes the final deployed production environment for Science Island on Google Cloud Platform (GCP).


Compute

The entire platform runs on a single Compute Engine VM:

ComponentValue
VM Namesi-compute-1-<id>
Region / Zoneaustralia-southeast1-b
Machine Typee2-standard-2 (2 vCPU, 8GB RAM)
NetworkingPrivate VPC (10.10.0.0/24), External Static IP
OSDebian with Docker + Docker Compose

This VM hosts all services via docker-compose.yml.


Containers Running on the VM

Service GroupPurpose
CaddyReverse proxy + TLS
KeycloakAuthentication + SSO
Platform Frontend & MicroservicesTeacher-facing system logic
Curriculum MapperCurriculum authoring and planning
PostgresKeycloak data
MySQL + RedisPlatform backend data + caching

All services communicate via an internal Docker network. Only Caddy is externally exposed.


Authentication Flow (Keycloak)

  • Login is performed via: https://login.scienceisland.com
  • Provides SSO for Platform + Game.
  • Redirect URIs are configured individually per client.

DNS + Reverse Proxy

SubdomainPurposeDestination
scienceisland.comPublic landing websiteStatic IP → Caddy
login.scienceisland.comKeycloak login UIStatic IP → Keycloak container
platform.scienceisland.comTeacher Portal UIStatic IP → Platform frontend
mapper.scienceisland.comCurriculum Mapper UIStatic IP → Mapper frontend

DNS is managed in Cloud DNS.
TLS certs are automatically issued and renewed by Caddy.


Secrets & Credentials

SecretStorageNotes
keycloak-admin-passwordGCP Secret ManagerUsed for Keycloak admin console
keycloak-db-passwordGCP Secret ManagerUsed by Keycloak → Postgres
Platform service .env valuesStored on VMShould be migrated to Secret Manager later

Deployment (CI/CD)

The platform uses automated deployments:

  1. Code is pushed to main.
  2. GitHub Actions builds new Docker images.
  3. Images are pushed to GitHub Container Registry (GHCR).
  4. The si-infra workflow connects to the VM and runs the following to restart services with the new versions:
    docker compose pull
    docker compose up -d

### Rollback

To revert a deployment:

1. Edit the relevant service’s image tag in `docker-compose.yml` to a previous version.
2. Commit the change to the `main` branch.
3. The CI/CD workflow will automatically redeploy using the previous image.

This ensures versioned, repeatable rollbacks with no manual SSH intervention.

---

## Known Limitations

| Limitation | Impact |
|-----------|--------|
| **Single VM deployment** | No horizontal scaling or redundancy — if the VM goes down, the whole platform is unavailable. |
| **Manual Keycloak user provisioning** | User registration currently requires admin console access or API automation; no self-service sign-up yet. |
| **Platform microservices tightly coupled** | Updates may require coordinated deployments; future refactor could improve modularity. |

---

## Operational Quick Reference

| Task | Command |
|------|---------|
| Restart services | `docker compose up -d` |
| Check logs for a service | `docker logs <container-name> --follow` |
| Check running containers | `docker compose ps` |
| SSH into the VM | `gcloud compute ssh si-compute-1-<id> --zone=australia-southeast1-b` |