Coder Templates
Terraform-based workspace templates for consistent, portable development environments
Production-ready Coder workspace templates designed for Terminal-Jarvis development. Templates use Terraform to provision containerized workspaces with pre-configured toolchains including Node.js 20, Python 3, Rust, and development utilities.
Overview
Terraform-based workspace templates that provision complete development environments on Coder with pre-installed toolchains, observability dashboards, and persistent storage. Templates target both local Docker deployments and cloud infrastructure, with an emphasis on free-tier and low-cost options.
Quick Links
Project Status
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)
Architecture
Template Model
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.
Persistence Strategy
- 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
Observability
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)
Quick Start
1. Package Template
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
2. Upload to Coder
- Navigate to Coder dashboard
- Go to Templates → Create Template
- Upload generated
.tarfile - Configure template variables (see template README)
- Create workspace from template
3. Template-Specific Setup
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
Available Templates
terminal-jarvis-playground/local-docker
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
terminal-jarvis-playground/gcp
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
Cloud Deployment Models
Guides for running templates on common cloud free tiers and low-cost infrastructure:
- Docker Desktop (Local Baseline)
- GCP Deployment (Always Free)
- AWS Deployment (Free Tier)
- Azure Deployment (Free/Low-Cost)
- Limitations & Constraints
Each guide covers: - Recommended instance sizes and limits - Optional swap and resource tuning - Cost optimization strategies
Documentation
For comprehensive documentation, visit the GitHub repository and explore the docs/ directory.