C
Coder.com3mo ago
-maV.

Docker (Devcontainer) enviro takes awhile to load

Hey all, If I'm running a docker (Devcontainer) template and it's taking awhile to spin up each time, is there away to make files cache and all changes make persist? Attached is my docker-compose:
services:
coder:
depends_on:
database:
condition: service_healthy
environment:
CODER_ACCESS_URL: http://192.168.2.17:7080
CODER_HTTP_ADDRESS: 0.0.0.0:7080
CODER_PG_CONNECTION_URL: >-
postgresql://${POSTGRES_USER:-xxxxxxxxxxx}:${POSTGRES_PASSWORD:-xxxxxxxxx}@database/${POSTGRES_DB:-xxxxxxxxxxx}?sslmode=disable
group_add:
- '999'
image: ghcr.io/coder/coder:${CODER_VERSION:-latest}
ports:
- '7080:7080'
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- coder_home:/home/coder
database:
environment:
POSTGRES_DB: ${POSTGRES_DB:-xxxxxxxxxxxxxxxxx}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-xxxxxxxxxxxx}
POSTGRES_USER: ${POSTGRES_USER:-xxxxxxxxxxx}
healthcheck:
interval: 5s
retries: 5
test:
- CMD-SHELL
- pg_isready -U ${POSTGRES_USER:-xxxxxxxxx} -d ${POSTGRES_DB:-xxxxxxxxxxxxxx}
timeout: 5s
image: postgres:17
volumes:
- coder_data:/var/lib/postgresql/data
version: '3.9'
volumes:
coder_data: Null
coder_home: Null
services:
coder:
depends_on:
database:
condition: service_healthy
environment:
CODER_ACCESS_URL: http://192.168.2.17:7080
CODER_HTTP_ADDRESS: 0.0.0.0:7080
CODER_PG_CONNECTION_URL: >-
postgresql://${POSTGRES_USER:-xxxxxxxxxxx}:${POSTGRES_PASSWORD:-xxxxxxxxx}@database/${POSTGRES_DB:-xxxxxxxxxxx}?sslmode=disable
group_add:
- '999'
image: ghcr.io/coder/coder:${CODER_VERSION:-latest}
ports:
- '7080:7080'
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- coder_home:/home/coder
database:
environment:
POSTGRES_DB: ${POSTGRES_DB:-xxxxxxxxxxxxxxxxx}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-xxxxxxxxxxxx}
POSTGRES_USER: ${POSTGRES_USER:-xxxxxxxxxxx}
healthcheck:
interval: 5s
retries: 5
test:
- CMD-SHELL
- pg_isready -U ${POSTGRES_USER:-xxxxxxxxx} -d ${POSTGRES_DB:-xxxxxxxxxxxxxx}
timeout: 5s
image: postgres:17
volumes:
- coder_data:/var/lib/postgresql/data
version: '3.9'
volumes:
coder_data: Null
coder_home: Null
running in TrueNAS via it's custom yaml (custom docker-compose) mechanic (https://www.truenas.com/docs/scale/scaleuireference/apps/installcustomappscreens/#add-custom-app-screen) read https://coder.com/docs/admin/templates/extending-templates/resource-persistence but it looks like even with
data "coder_workspace" "me" {
}

resource "docker_volume" "home_volume" {
# This resource will survive until either the entire block is deleted
# or the workspace is.
name = "coder-${data.coder_workspace.me.id}-home"
lifecycle {
ignore_changes = all
}
}
data "coder_workspace" "me" {
}

resource "docker_volume" "home_volume" {
# This resource will survive until either the entire block is deleted
# or the workspace is.
name = "coder-${data.coder_workspace.me.id}-home"
lifecycle {
ignore_changes = all
}
}
it still takes a bit to load up each time defeating the convenience.
10 Replies
Codercord
Codercord3mo ago
Codercord
Codercord3mo ago
<#1396839072562942062>
Category
Help needed
Product
Coder (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
-maV.
-maV.OP3mo ago
No description
-maV.
-maV.OP3mo ago
^ after 4mins or so
-maV.
-maV.OP3mo ago
No description
-maV.
-maV.OP3mo ago
^ after about 9mins still loading. Would ideally like to boot up my TrueNAS server, and this enviro would be up and running in about 5mins tops along with my other TrueNAS apps
Phorcys
Phorcys3mo ago
@-maV. are you able to share your devcontainer.json file?
-maV.
-maV.OP3mo ago
where do I find that exactly? I think my docker-compose doesn't really have volumes mounted persistently does it??
{
"name": "Code - OSS",
"build": {
"dockerfile": "Dockerfile"
},
"features": {
"ghcr.io/devcontainers/features/desktop-lite:1": {},
"ghcr.io/devcontainers/features/rust:1": {}
},
"containerEnv": {
"DISPLAY": "" // Allow the Dev Containers extension to set DISPLAY, post-create.sh will add it back in ~/.bashrc and ~/.zshrc>
},
"overrideCommand": false,
"privileged": true,
"mounts": [
{
"source": "vscode-dev",
"target": "/vscode-dev",
"type": "volume"
}
],
"postCreateCommand": "./.devcontainer/post-create.sh",
"customizations": {
"vscode": {
"settings": {
"resmon.show.battery": false,
"resmon.show.cpufreq": false
},
"extensions": [
"dbaeumer.vscode-eslint",
"EditorConfig.EditorConfig",
"GitHub.vscode-pull-request-github",
"ms-vscode.vscode-github-issue-notebooks",
"ms-vscode.vscode-selfhost-test-provider",
"mutantdino.resourcemonitor"
]
}
},
"forwardPorts": [6080, 5901],
"portsAttributes": {
"6080": {
"label": "VNC web client (noVNC)",
"onAutoForward": "silent"
},
"5901": {
"label": "VNC TCP port",
"onAutoForward": "silent"
}
},
"hostRequirements": {
"memory": "9gb"
}
}
{
"name": "Code - OSS",
"build": {
"dockerfile": "Dockerfile"
},
"features": {
"ghcr.io/devcontainers/features/desktop-lite:1": {},
"ghcr.io/devcontainers/features/rust:1": {}
},
"containerEnv": {
"DISPLAY": "" // Allow the Dev Containers extension to set DISPLAY, post-create.sh will add it back in ~/.bashrc and ~/.zshrc>
},
"overrideCommand": false,
"privileged": true,
"mounts": [
{
"source": "vscode-dev",
"target": "/vscode-dev",
"type": "volume"
}
],
"postCreateCommand": "./.devcontainer/post-create.sh",
"customizations": {
"vscode": {
"settings": {
"resmon.show.battery": false,
"resmon.show.cpufreq": false
},
"extensions": [
"dbaeumer.vscode-eslint",
"EditorConfig.EditorConfig",
"GitHub.vscode-pull-request-github",
"ms-vscode.vscode-github-issue-notebooks",
"ms-vscode.vscode-selfhost-test-provider",
"mutantdino.resourcemonitor"
]
}
},
"forwardPorts": [6080, 5901],
"portsAttributes": {
"6080": {
"label": "VNC web client (noVNC)",
"onAutoForward": "silent"
},
"5901": {
"label": "VNC TCP port",
"onAutoForward": "silent"
}
},
"hostRequirements": {
"memory": "9gb"
}
}
I think this might be it but not sure
Phorcys
Phorcys2mo ago
yes i think desktop-lite might be the one making it so slow can you try removing that feature and retrying? hey @-maV. I will close this issue since it is stale but feel free to reopen it!
Codercord
Codercord2mo ago
@Phorcys closed the thread.

Did you find this page helpful?