89 lines
2.8 KiB
Markdown
89 lines
2.8 KiB
Markdown
---
|
|
display_name: Backend Development Workspace
|
|
description: Docker workspace for backend development with Go, Node.js, Bun, Opencode, and Claude Code.
|
|
icon: /icon/go.svg
|
|
maintainer_github: sirblob
|
|
verified: false
|
|
tags: [docker, container, gpu, golang, nodejs, bun, opencode, claude, ollama]
|
|
---
|
|
|
|
# Backend Development Workspace
|
|
|
|
Docker workspace for backend development with Go, Node.js, Bun, Opencode, and Claude Code.
|
|
|
|
Provisions a Docker container as a [Coder workspace](https://coder.com/docs/workspaces) with selectable GPU passthrough, Docker-out-of-Docker, and a persistent home directory.
|
|
|
|
## Preinstalled tools
|
|
|
|
- Go, latest stable release
|
|
- Node.js 22 with npm and npx
|
|
- Bun
|
|
- Opencode
|
|
- Claude Code
|
|
- Docker CLI for Docker-out-of-Docker
|
|
- Gitea CLI (`tea`)
|
|
- code-server and JetBrains Toolbox support
|
|
|
|
## Parameters
|
|
|
|
| Parameter | Description | Default |
|
|
| --- | --- | --- |
|
|
| `GPU Assignment` | Which GPU(s) to attach: GPU 0, GPU 1, or both. GPU 1 is shared with the Ollama and Immich stacks. | GPU 0 |
|
|
|
|
## Prerequisites
|
|
|
|
The host needs the NVIDIA container toolkit for GPU passthrough. Coder itself runs as a container and creates workspaces through the host's Docker socket, so its service needs the socket mounted and the host `docker` group added:
|
|
|
|
```yaml
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
group_add:
|
|
- "987"
|
|
```
|
|
|
|
Workspaces get the same GID through the `docker_group_id` template variable, which defaults to `987`. Confirm the host GID with `getent group docker` and override the variable if it differs.
|
|
|
|
## Ollama
|
|
|
|
`OLLAMA_HOST` is preset to `http://host.docker.internal:11434`. Verify with:
|
|
|
|
```sh
|
|
curl "$OLLAMA_HOST/api/tags"
|
|
```
|
|
|
|
## Gitea
|
|
|
|
The `tea` CLI manages repositories, issues, and pull requests from the workspace:
|
|
|
|
```sh
|
|
tea login add --name sirblob --url https://git.sirblob.co --token <token>
|
|
tea repos list
|
|
```
|
|
|
|
Docker-out-of-Docker lets you build and push images to the registry:
|
|
|
|
```sh
|
|
docker login git.sirblob.co -u <user> -p <token>
|
|
docker build -t git.sirblob.co/<user>/<image>:<tag> .
|
|
docker push git.sirblob.co/<user>/<image>:<tag>
|
|
```
|
|
|
|
## Updates
|
|
|
|
The image is built with the base packages already upgraded, and the agent runs `apt-get update` and `apt-get upgrade` on every workspace start so a long-lived container keeps picking up security updates.
|
|
|
|
## Persistence
|
|
|
|
`/home/coder` is mapped to a host directory and survives workspace restarts. The rest of the root filesystem is ephemeral, so every preinstalled tool lives under `/opt` or `/usr/local` instead of the home directory.
|
|
|
|
## Files
|
|
|
|
| File | Contents |
|
|
| --- | --- |
|
|
| `main.tf` | Providers, data sources, and shared locals |
|
|
| `parameters.tf` | Workspace parameters |
|
|
| `agent.tf` | Coder agent, startup script, and metadata |
|
|
| `apps.tf` | code-server and JetBrains modules |
|
|
| `container.tf` | Docker image build and container resource |
|
|
| `Dockerfile` | Workspace image |
|