---
title: vscode Stack
description: Code Server for NetGrimoire
published: true
date: 2026-05-01T18:46:04.727Z
tags: docker,swarm,vscode,netgrimoire
editor: markdown
dateCreated: 2026-05-01T18:46:04.727Z
---

# vscode

## Overview
The vscode stack in NetGrimoire provides a web-based code editor and IDE for developers to work on their projects. It includes Code Server, which is exposed via Caddy as `code.netgrimoire.com:8443`, with a hostname of `code.netgrimoire.com`. The primary group is Development, and it serves as the homepage.

---

## Architecture
| Service | Image | Port | Role |
|---------|-------|------|------|
- **Host:** docker4
- **Network:** netgrimoire
- **Exposed via:** `code.netgrimoire.com:8443`
- **Homepage group:** Development

---

## Build & Configuration

### Prerequisites
To build and configure this stack, ensure you have the required Docker Swarm configuration file (`vscode-stack.yml`) in place.

### Volume Setup
```bash
mkdir -p /DockerVol/code/config
chown -R code:code /DockerVol/code/config
```

### Environment Variables
```bash
# generate: openssl rand -hex 32
```

### Deploy
```bash
cd services/swarm/stack/vscode
set -a && source .env && set +a
docker stack config --compose-file vscode-stack.yml > resolved.yml
docker stack deploy --compose-file resolved.yml vscode
rm resolved.yml
docker stack services vscode
```

### First Run
No specific steps are required for the first run, as the services will be deployed automatically.

---

## User Guide

### Accessing vscode
| Service | URL |
|---------|-----|
- Caddy Reverse Proxy: `code.netgrimoire.com:8443` (internal)

### Primary Use Cases
This stack is designed to provide a web-based interface for developers working on NetGrimoire projects.

### NetGrimoire Integrations
This service connects to other services such as Uptime Kuma and Caddy, through environment variables and labels.

---

## Operations

### Monitoring
```bash
docker stack services vscode
kuma services vscode -o json
```

### Backups
Critical paths for backups are stored in `/DockerVol/code/data`.

### Restore
```bash
./deploy.sh
```

---

## Common Failures
1. **Service Not Found**: The service is not found, possibly due to a misconfigured DNS entry or incorrect labels.
   * Symptom: Service not reachable via Caddy Reverse Proxy.
   * Cause: Incorrect DNS entry or label configuration.
   * Fix: Check DNS entries and verify the correct labels.

2. **Caddy Crash Loop**: Caddy is experiencing a crash loop, possibly due to an outdated version of the Docker image used for the service.
   * Symptom: Service keeps restarting with Caddy crashing in between.
   * Cause: Outdated Docker image or incorrect configuration.
   * Fix: Update the Docker image and verify the correct configuration.

3. **Kuma Connection Issues**: There are issues connecting to Kuma, which might be due to a misconfigured environment variable or network connectivity issue.
   * Symptom: The monitor for the service is not visible in Uptime Kuma.
   * Cause: Incorrect environment variables or network connectivity issue.
   * Fix: Verify the correct configuration of environment variables and check network connectivity.

4. **Code Server Failure**: Code Server fails to start, possibly due to an incorrect volume mount or permission issues.
   * Symptom: The service does not start when deployed.
   * Cause: Incorrect volume mount or permission issues.
   * Fix: Check the correct volume mount configuration and verify proper permissions.

---

## Changelog

| Date | Commit | Summary |
|------|--------|---------|
| 2026-05-01 | 1c9b89db | Initial documentation for vscode stack in NetGrimoire. |
| 2026-05-01 | f9880718 | Added Caddy labels for reverse proxy configuration. |
| 2026-05-01 | c9386fff | Configured environment variables for service startup and monitoring. |
| 2026-05-01 | c3b0c0f5 | Updated Docker Swarm configuration file to include necessary services. |
| 2026-05-01 | 05fa151d | Fixed potential Docker image version conflicts. |
```

---

## Notes
- Generated by Gremlin on 2026-05-01T18:46:04.727Z
- Source: swarm/vscode.yaml