feat(code-server): give the workspace its own volume

The workspace moves off the config volume onto code-server-workspace, so
wiping editor state and wiping code are separate acts.

The image only ever chowns the literal path /config/workspace, and reads
DEFAULT_WORKSPACE to pick the folder to open, so a named volume on /workspace
would come up root-owned and unwritable. Creating the directory in a local
Dockerfile seeds the volume with the right ownership instead.
This commit is contained in:
tiennm99 committed 2026-09-18 17:38:07 +07:00
1 parent ff9ec68b0b
commit a63c121075
4 files changed
+62 -5

No files matched your search

+4 -2
View File
@@ -1,6 +1,6 @@
services:
code-server:
image: 'lscr.io/linuxserver/code-server:latest'
build: .
hostname: ${SERVICE_HOSTNAME}
environment:
- PUID=1000
@@ -11,7 +11,7 @@ services:
- INSTALL_PACKAGES=gh|git|glab|unzip|zip
- NODEJS_MOD_VERSION=24
- TZ=Asia/Ho_Chi_Minh
- DEFAULT_WORKSPACE=/config/workspace
- DEFAULT_WORKSPACE=/workspace
- GIT_AUTHOR_NAME=${GIT_NAME}
- GIT_AUTHOR_EMAIL=${GIT_EMAIL}
- GIT_COMMITTER_NAME=${GIT_NAME}
@@ -20,6 +20,8 @@ services:
- PWA_APPNAME=code-server
volumes:
- 'code-server-config:/config'
- 'code-server-workspace:/workspace'
- '/var/run/docker.sock:/var/run/docker.sock:ro'
volumes:
code-server-config:
code-server-workspace: