Terraform-based workspace templates for creating consistent, portable development environments on Coder.
This repository provides production-ready Coder workspace templates designed for the Terminal-Jarvis development environment. Templates use Terraform to provision containerized workspaces with pre-configured toolchains including Node.js 20, Python 3, Rust, and development utilities. The templates target both local Docker deployments and cloud infrastructure, with an emphasis on free-tier and low-cost options.
Implemented:
- Local Docker template using Docker containers with persistent volumes
- GCP Compute Engine template using bare VM architecture
- Multi-platform packaging scripts (Linux, macOS, Windows)
- Comprehensive deployment documentation for GCP, AWS, and Azure
- Development container for contributors
- Resource monitoring and observability built into templates
Planned:
- Feature flags for optional components (JetBrains Gateway, resource limits)
- Multi-architecture image builds (AMD64 + ARM64) via GitHub Actions
- AWS and Azure template implementations (documentation exists, Terraform pending)
- Automated linting and validation pipeline (tflint, trivy/grype)
- Secret management patterns (dotfiles, cloud secret managers)
See CLAUDE.md for detailed roadmap and development guidelines.
Each template consists of three core components:
- Dockerfile - Defines the workspace runtime environment with pre-installed tools
- main.tf - Terraform configuration declaring Coder resources and infrastructure
- README.md - Deployment-specific setup and configuration instructions
Templates are packaged into .tar archives and uploaded to Coder for workspace provisioning.
- Ephemeral: Workspace container or VM (recreated on restart)
- Persistent: User data in
/home/codervia Docker volumes or attached disks - Consequence: Tools installed outside persistent paths must be baked into Dockerfile
local-docker:
- Providers:
coder/coder,kreuzwerker/docker - Resources: Docker container with persistent volume
- Modules: code-server (VS Code in browser), JetBrains Gateway
- Base Image:
codercom/enterprise-base:ubuntu
gcp:
- Providers:
coder/coder,google - Resources: Compute Engine VM with persistent root disk
- Modules: code-server, optional Archestra.ai integration
- Base Image:
ubuntu:22.04with code-server pre-installed - Architecture: Bare VM with systemd-managed Coder agent
Templates include real-time dashboard metrics:
- CPU usage (container/host)
- RAM usage with percentage utilization
- Disk usage for home directory
- Load average scaled by CPU count
- Swap usage (critical for memory-constrained instances)
See main.tf:89-148 in local-docker template for implementation details.
Run the packaging script for your platform:
# Interactive mode - presents menu of templates
./package.linux.sh # Linux
./package.mac.sh # macOS
./package.windows.sh # Windows (Git Bash/WSL)
# Direct mode - package specific template
./package.linux.sh local-docker # Creates terminal-jarvis-playground-local.tar
./package.linux.sh gcp # Creates terminal-jarvis-playground-gcp.tar
./package.linux.sh all # Creates both archives- Navigate to Coder dashboard
- Go to Templates → Create Template
- Upload generated
.tarfile - Configure template variables (see template README)
- Create workspace from template
Consult the README in each template directory for deployment-specific requirements:
terminal-jarvis-playground/local-docker/README.md- Docker Desktop setupterminal-jarvis-playground/gcp/README.md- GCP credentials and project configuration
Docker-based workspace for local development and testing.
Requirements:
- Docker Desktop or Docker Engine
- 2+ GiB RAM recommended (JetBrains IDEs require 4+ GiB)
Features:
- Persistent
/home/codervolume - code-server for browser-based VS Code
- JetBrains Gateway support (IntelliJ, PyCharm, WebStorm, etc.)
- Automatic git configuration from Coder user metadata
Terraform Variables:
docker_socket(optional) - Custom Docker socket path
See: terminal-jarvis-playground/local-docker/README.md
Google Compute Engine deployment using ephemeral VMs with persistent disks.
Requirements:
- GCP project with Compute Engine API enabled
- Service account with
compute.instanceAdmin.v1role - Service account JSON key file
Features:
- Bare VM architecture (no Docker dependency)
- Always Free tier eligible (e2-micro, 30 GB disk)
- Systemd-managed Coder agent with auto-restart
- Optional Archestra.ai integration
- Optional Docker installation for container workflows
Terraform Variables:
project_id(required) - GCP project IDzone(optional) - Compute zone, default:us-central1-amachine_type(optional) - Instance size, default:e2-microdisk_size(optional) - Root disk GB, default:30gcp_credentials(sensitive) - Service account JSON keyenable_archestra(optional) - Enable Archestra.ai, default:falseenable_docker(optional) - Install Docker, default:false
See: terminal-jarvis-playground/gcp/README.md
Detailed deployment guides are available for multiple platforms:
| Platform | Status | Guide | Free Tier Details |
|---|---|---|---|
| Docker Desktop | Implemented | docs/deployment_models/DockerDesktop.md |
Local baseline |
| Google Cloud Platform | Implemented | docs/deployment_models/GCP.md |
e2-micro, 30 GB disk (Always Free) |
| Amazon Web Services | Documented | docs/deployment_models/AWS.md |
t2.micro (12-month free tier) |
| Microsoft Azure | Documented | docs/deployment_models/Azure.md |
B1s (limited free tier) |
Note: AWS and Azure guides document deployment approaches, but Terraform templates are not yet implemented. Contributions welcome.
See docs/deployment_models/limitations.md for comprehensive resource constraints and platform-specific caveats.
Memory:
- 1 GiB RAM instances (GCP e2-micro, AWS t2.micro/t4g.micro, Azure B1s) cannot reliably run JetBrains IDE backends
- Minimum 2 GiB RAM recommended for code-server only
- Minimum 4 GiB RAM recommended for JetBrains Gateway
- 1 GiB swap recommended for memory-constrained instances
CPU:
- Azure B1s enforces CPU credit limits that can throttle sustained workloads
- AWS t2/t4g instances have similar burstable CPU constraints
- GCP e2-micro provides 2 vCPUs with 0.25-1.0 vCPU sustained usage
Disk:
- GCP Always Free: 30 GB standard persistent disk
- AWS Free Tier: 30 GB EBS storage
- Azure Free: 64 GB disk (B1s)
- Target workspace image size: < 1.2 GB compressed
Architecture:
- ARM64 support critical for AWS t4g instances and Apple Silicon
- Use
docker buildx --platform linux/amd64,linux/arm64for multi-arch images
See docs/deployment_models/limitations.md for detailed analysis and mitigation strategies.
Each template directory contains:
terminal-jarvis-playground/{template-name}/
├── Dockerfile # Workspace runtime environment
├── main.tf # Terraform configuration
└── README.md # Deployment-specific instructions
Defines the workspace image with pre-installed development tools:
- Ubuntu base (22.04 or Coder enterprise base)
- Node.js 20 (via nvm)
- Python 3 with uv package manager
- Rust 1.87.0 toolchain
- Git, GitHub CLI, and common utilities
- Platform-specific additions (code-server for GCP)
Terraform configuration declaring:
- Required providers (Coder + infrastructure provider)
- Template variables with defaults and validation
- Coder agent with startup scripts and environment
- Infrastructure resources (containers, VMs, volumes, disks)
- Coder modules (code-server, JetBrains Gateway)
- Monitoring metadata (CPU, RAM, disk, load, swap)
Deployment guide covering:
- Prerequisites and setup requirements
- Building and publishing workspace images
- Configuring Terraform variables
- Creating and managing workspaces
- Troubleshooting common issues
- Docker Desktop or Docker Engine
- Terraform 1.0+
- Git
Use the development container for consistent contributor environments:
# Open in VS Code with Remote Containers extension
code .devcontainer
# Or manually build and run
docker build -t coder-templates-dev .devcontainer/
docker run -it -v $(pwd):/workspace coder-templates-devSee .devcontainer/README.md for full setup instructions.
# Validate Terraform configuration
cd terminal-jarvis-playground/{template-name}
terraform init
terraform validate
terraform fmt -check
# Build Docker image
docker build -t test-image:latest .
# Package template
cd ../..
./package.linux.sh {template-name}Refer to .github/copilot-instructions.md and CLAUDE.md for style guidelines:
- No emojis in code, documentation, or commit messages
- High-signal comments only
- Semantic section headers in documentation
- Sensible defaults that work without flags
- Small, composable Terraform changes
Recommended for auto-generating module documentation from Terraform files.
Installation:
# macOS
brew install terraform-docs
# Linux
curl -Lo terraform-docs.tar.gz https://github.com/terraform-docs/terraform-docs/releases/download/v0.17.0/terraform-docs-v0.17.0-linux-amd64.tar.gz
tar -xzf terraform-docs.tar.gz
chmod +x terraform-docs
sudo mv terraform-docs /usr/local/bin/Usage:
# Generate markdown documentation
cd terminal-jarvis-playground/local-docker
terraform-docs markdown table . > TERRAFORM.md
# Update README with embedded docs
terraform-docs markdown table . --output-file README.md --output-mode injectIntegration:
Consider adding to .git/hooks/pre-commit to auto-update documentation on commit. See docs/maintainers/gcp/maintenance-guide.md for automation examples.
- tflint - Terraform linter for catching errors and enforcing best practices
- trivy or grype - Container image vulnerability scanning
- hadolint - Dockerfile linting
These tools are planned for CI/CD integration but not yet implemented. Contributions welcome.
Contributions are welcome for:
- AWS and Azure template implementations
- Multi-architecture image builds
- Feature flag implementation (JetBrains Gateway, resource limits)
- Additional cloud provider templates (DigitalOcean, Hetzner, Linode)
- Documentation improvements
- CI/CD automation
Follow the structure established in existing templates and maintain consistency with style guidelines in CLAUDE.md.
For maintainers managing deployed templates:
docs/maintainers/gcp/maintenance-guide.md- GCP-specific operational procedures
See LICENSE file for details.