Deployment repository for the ecomod research server stack.
This stack provides a lightweight remote research environment consisting of:
- RStudio Server
- VS Code (code-server)
- Caddy reverse proxy with automatic HTTPS (Let's Encrypt)
All services run in Docker containers and are orchestrated using Docker Compose.
The repository is designed so the same deployment artifacts can be used for:
- provisioning new machines via cloud-init
- manual migration of existing servers
- routine updates
Internet
│
▼
┌───────────────┐
│ Caddy │ (TLS termination + routing)
└───────┬───────┘
│
├─────────────► RStudio Server
│ (port 8787)
│
└─────────────► code-server (VS Code)
(port 8443)
Routing:
| URL | Service |
|---|---|
/ |
RStudio |
/code/ |
VS Code |
Caddy automatically obtains and renews TLS certificates via Let's Encrypt.
ecomod-server/
├── .env.example
├── docker-compose.yml
├── Caddyfile
├── scripts/
│ ├── install-prereqs.sh
│ ├── prepare-directories.sh
│ ├── start-stack.sh
│ └── update-stack.sh
├── docs/
│ └── migration-guide.md
└── cloud-init/
└── cloud-init.yaml
Template for per-server configuration.
Copy to .env and adjust values.
Defines the service stack:
caddyrstudiocode-server
Reverse proxy configuration and TLS setup.
Operational scripts for convinience.
| Script | Purpose |
|---|---|
install-prereqs.sh |
installs Docker and required packages |
prepare-directories.sh |
creates persistent storage directories |
start-stack.sh |
launches the stack |
update-stack.sh |
updates container images |
./scripts/install-prereqs.sh
cp .env.example .env
nano .env
chmod 600 .env
./scripts/start-stack.sh
After startup:
| Service | URL |
|---|---|
| RStudio | https://SERVER_URL/ |
| VS Code | https://SERVER_URL/code/ |
Credentials:
username: rstudio
password: USER_PASSWORD
Pull new container images and restart services:
./scripts/update-stack.sh
Check running services:
docker compose ps
Follow logs:
docker compose logs -f --tail=200
Check Caddy specifically:
docker compose logs -f --tail=200 caddy
Persistent data is stored under:
volumes/
├── workspace
├── code_config
├── caddy_data
└── caddy_config
These directories contain:
| Directory | Purpose |
|---|---|
workspace |
shared working directory for RStudio and VS Code |
code_config |
VS Code configuration |
caddy_data |
TLS certificates |
caddy_config |
Caddy runtime configuration |
These directories are not part of the Git repo.
New VMs can automatically provision the server stack via:
cloud-init/cloud-init.yaml
The cloud-init configuration:
- clones this repository
- writes the
.envfile - runs the same repo scripts used for manual deployment