Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Healthcheck issue #7132

Unanswered
lordlightman asked this question in General
Dec 19, 2024 · 1 comments · 1 reply
Discussion options

Hello.

I am experiencing a weird issue with healthcheck that prevents Code Server from working properly. Whenever I'm using an expression like this as a test

curl -fksSL http://localhost:8443/healthz | grep -o alive || exit 1

Code Server does not work - Web UI is not accessible, and healthz endpoint reports expired.

But when I use ['CMD', 'curl', '-fksSL', 'http://localhost:8443/healthz'] everything works fine, Code Server starts and within 10-20 seconds healthz reports 'alive'.

Does anyone know what could be the issue? Am I doing something wrong?

Here is my full docker-compose.yaml:

services:
 code-server:
 image: linuxserver/code-server:4.96.1
 container_name: code-server
 restart: unless-stopped
 #ports:
 # - 8443:8443
 volumes:
 - ./config:/config
 environment:
 - PUID=1000
 - PGID=1000
 - TZ=Europe/Kyiv
 labels:
 - "traefik.enable=true"
 - "traefik.http.routers.code-server.rule=Host(`vscode.example.com`)"
 - "traefik.http.routers.code-server.entrypoints=https"
 - "traefik.http.routers.code-server.tls=true"
 - "traefik.http.services.code-server.loadbalancer.server.port=8443"
 - "traefik.docker.network=traefik"
 security_opt:
 - no-new-privileges:true
 networks:
 traefik:
 healthcheck:
 # causes Code Server to fail
 test: "curl -fksSL http://localhost:8443/healthz | grep -o alive || exit 1"
 # works fine
 # test: ['CMD', 'curl', '-fksSL', 'http://localhost:8443/healthz']
 start_period: 60s
 interval: 60s
 timeout: 20s
 retries: 3
networks:
 traefik:
 external: true
You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

expired just means nothing has connected to it recently, code-server is still up and running as long as you get any valid 200 response from that endpoint.

You must be logged in to vote
1 reply
Comment options

expired does seem confusing though. It probably should have been "inactive" instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /