🐛 Bug Report: Unable to change CADDY PORT #397

Closed
opened 2025-10-09 16:44:19 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @Math43 on GitHub.

Reproduction steps

Hello, when I try to change caddy port to something else from 80 (already used on my system) I can't access to setup.

Docker compose file:

services:
  pocket-id:
    image: stonith404/pocket-id  # or ghcr.io/stonith404/pocket-id
    restart: unless-stopped
    env_file: .env
    ports:
      - 3000:81
    volumes:
      - "./data:/app/backend/data"

.env file:

PUBLIC_APP_URL=https://auth.domain.com
TRUST_PROXY=true
MAXMIND_LICENSE_KEY=
PUID=1000
PGID=100
CADDY_PORT=81

docker ps

$sudo docker ps | grep pocket
842a9486f4e6   stonith404/pocket-id    "sh ./scripts/docker…"   30 seconds ago   Up 29 seconds (health: starting)   80/tcp, 0.0.0.0:3000->81/tcp, [::]:3000->81/tcp   pocket-id-pocket-id-1

docker logs

$ sudo docker logs -f pocket-id-pocket-id-1
Creating user and group...
addgroup: gid '100' in use
adduser: unknown group pocket-id-group
Starting frontend...
Starting backend...
Starting Caddy...
2025/01/20 16:44:38 Updating GeoLite2 City database...
2025/01/20 16:44:38 Failed to update GeoLite2 City database: failed to download database, received HTTP 401
{"level":"info","ts":1737391478.6171558,"msg":"using config from file","file":"/etc/caddy/Caddyfile.trust-proxy"}
{"level":"info","ts":1737391478.620623,"msg":"adapted config to JSON","adapter":"caddyfile"}
{"level":"info","ts":1737391478.6231108,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//localhost:2019","//[::1]:2019","//127.0.0.1:2019"]}
{"level":"info","ts":1737391478.6237798,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc000427700"}
{"level":"warn","ts":1737391478.6251235,"logger":"tls","msg":"unable to get instance ID; storage clean stamps will be incomplete","error":"mkdir /.local: permission denied"}
{"level":"error","ts":1737391478.6258395,"logger":"tls","msg":"could not clean default/global storage","error":"unable to acquire storage_clean lock: creating lock file: open /.local/share/caddy/locks/storage_clean.lock: no such file or directory"}
{"level":"info","ts":1737391478.6259546,"logger":"tls","msg":"finished cleaning storage units"}
{"level":"info","ts":1737391478.6264324,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
{"level":"error","ts":1737391478.6271389,"msg":"unable to create folder for config autosave","dir":"/.config/caddy","error":"mkdir /.config: permission denied"}
{"level":"info","ts":1737391478.6272643,"msg":"serving initial configuration"}
Successfully started Caddy (pid=38) - Caddy is running in the background
Listening on 0.0.0.0:3000

Expected behavior

Access to Pocked-ID through port 81

Actual Behavior

I can access to frontent on host:3000 but host:81 or host:80 give nothing.

Originally created by @Math43 on GitHub. ### Reproduction steps Hello, when I try to change caddy port to something else from 80 (already used on my system) I can't access to setup. Docker compose file: ``` services: pocket-id: image: stonith404/pocket-id # or ghcr.io/stonith404/pocket-id restart: unless-stopped env_file: .env ports: - 3000:81 volumes: - "./data:/app/backend/data" ``` .env file: ``` PUBLIC_APP_URL=https://auth.domain.com TRUST_PROXY=true MAXMIND_LICENSE_KEY= PUID=1000 PGID=100 CADDY_PORT=81 ``` docker ps ``` $sudo docker ps | grep pocket 842a9486f4e6 stonith404/pocket-id "sh ./scripts/docker…" 30 seconds ago Up 29 seconds (health: starting) 80/tcp, 0.0.0.0:3000->81/tcp, [::]:3000->81/tcp pocket-id-pocket-id-1 ``` docker logs ``` $ sudo docker logs -f pocket-id-pocket-id-1 Creating user and group... addgroup: gid '100' in use adduser: unknown group pocket-id-group Starting frontend... Starting backend... Starting Caddy... 2025/01/20 16:44:38 Updating GeoLite2 City database... 2025/01/20 16:44:38 Failed to update GeoLite2 City database: failed to download database, received HTTP 401 {"level":"info","ts":1737391478.6171558,"msg":"using config from file","file":"/etc/caddy/Caddyfile.trust-proxy"} {"level":"info","ts":1737391478.620623,"msg":"adapted config to JSON","adapter":"caddyfile"} {"level":"info","ts":1737391478.6231108,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//localhost:2019","//[::1]:2019","//127.0.0.1:2019"]} {"level":"info","ts":1737391478.6237798,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc000427700"} {"level":"warn","ts":1737391478.6251235,"logger":"tls","msg":"unable to get instance ID; storage clean stamps will be incomplete","error":"mkdir /.local: permission denied"} {"level":"error","ts":1737391478.6258395,"logger":"tls","msg":"could not clean default/global storage","error":"unable to acquire storage_clean lock: creating lock file: open /.local/share/caddy/locks/storage_clean.lock: no such file or directory"} {"level":"info","ts":1737391478.6259546,"logger":"tls","msg":"finished cleaning storage units"} {"level":"info","ts":1737391478.6264324,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]} {"level":"error","ts":1737391478.6271389,"msg":"unable to create folder for config autosave","dir":"/.config/caddy","error":"mkdir /.config: permission denied"} {"level":"info","ts":1737391478.6272643,"msg":"serving initial configuration"} Successfully started Caddy (pid=38) - Caddy is running in the background Listening on 0.0.0.0:3000 ``` ### Expected behavior Access to Pocked-ID through port 81 ### Actual Behavior I can access to frontent on host:3000 but host:81 or host:80 give nothing.
OVERLORD added the bug label 2025-10-09 16:44:19 +03:00
Author
Owner

@Math43 commented on GitHub:

Thanks @stonith404, I've revert to CADDY_PORT on 80, and only change expose port to 3001:80 and it's working much better !

I think I was misdirected by Environnement variables section of the docs where it's indicated If you want to change the exposed port of the container then you sould change this variable. for CADDY_PORT

@Math43 commented on GitHub: Thanks @stonith404, I've revert to `CADDY_PORT` on `80`, and only change expose port to `3001:80` and it's working much better ! I think I was misdirected by Environnement variables section of the docs where it's indicated `If you want to change the exposed port of the container then you sould change this variable. `for `CADDY_PORT`
Author
Owner

@stonith404 commented on GitHub:

You're exposing port 3000 so it's accessible only on this port. CADDY_PORT is just inside the container.

Try to keep CADDY_PORTon 80 and change the exposed ports to 7467:80. It should then listen on port 7467.

@stonith404 commented on GitHub: You're exposing port `3000` so it's accessible only on this port. `CADDY_PORT` is just inside the container. Try to keep `CADDY_PORT`on `80` and change the exposed ports to `7467:80`. It should then listen on port `7467`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pocket-id-pocket-id-2#397