ChrisRomp / hamclock-docker

A Dockerized version of HamClock by Elwood Downey WBØOEW.
MIT License
28 stars 4 forks source link

Failed to connect to localhost port 8080 after 2ms: container goes into "unhealthy" state #20

Closed richard-parker closed 3 months ago

richard-parker commented 3 months ago

Hello,

I've just attempted to run this via Docker Compose using the docker-compose.yaml below:

services:
  web:
    image: ghcr.io/chrisromp/hamclock-docker:latest
    ports:
      - "82:8080/tcp"
      - "83:8081/tcp"
    volumes:
      - data:/root/.hamclock/
    restart: unless-stopped

volumes:
  data:

After a couple of minutes in the starting state, the container enters the unhealthy state with the following log:

New program args:
  argv[0] = /usr/local/bin/hamclock
  argv[1] = -o

process id 1
built as hamclock-web-1600x960
working directory is /root/.hamclock/
ruid 0 euid 0
/etc/os-release:
    NAME="Alpine Linux"
    ID=alpine
    VERSION_ID=3.19.1
    PRETTY_NAME="Alpine Linux v3.19"
    HOME_URL="https://alpinelinux.org/"
    BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"
Linux b44cc5a0f73e 6.5.0-35-generic #35-Ubuntu SMP PREEMPT_DYNAMIC Fri Apr 26 11:23:57 UTC 2024 x86_64 Linux
Calling Arduino setup()
      0.519 HamClock version 4.01 platform HamClock-linux
      0.519 #define _IS_UNIX
      0.519 #define _IS_LINUX
      0.553 RA8875 found
      0.564 EEPROM size 55 + 1401 = 1456, max 4096
      0.564 BR: A onoff= 0 dim= 0
      0.587 BRB: choices:
      0.587     *NCDXF
      0.587 BRB: now mode 0
      0.587 /etc/wpa_supplicant/wpa_supplicant.conf: No such file or directory
      0.588 Display is 1600 x 960
      0.588 Built for 1600 x 960

Docker environment information:

Client: Docker Engine - Community
 Version:           26.1.3
 API version:       1.45
 Go version:        go1.21.10
 Git commit:        b72abbb
 Built:             Thu May 16 08:33:27 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          26.1.3
  API version:      1.45 (minimum version 1.24)
  Go version:       go1.21.10
  Git commit:       8e96db1
  Built:            Thu May 16 08:33:27 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.32
  GitCommit:        8b3b7ca2e5ce38e8f31a34f35b2b68ceb8470d89
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Any help you could offer would be appreciated!

Thanks

ChrisRomp commented 3 months ago

I ran your compose with no issues on my Ubuntu server. What's your operating system?

The output you shared is what I expect to see, and then I would look for HamClock at http://host-ip:83/live.html.

ChrisRomp commented 3 months ago

Also, just for good measure, try including the spec version in your compose:

version: "3"
services:
  web:
    image: ghcr.io/chrisromp/hamclock-docker:latest
    ports:
      - "82:8080/tcp"
      - "83:8081/tcp"
    volumes:
      - data:/root/.hamclock/
    restart: unless-stopped

volumes:
  data:
ChrisRomp commented 3 months ago

Closing due to lack of activity. Feel free to reopen.

richard-parker commented 3 months ago

Closing due to lack of activity. Feel free to reopen.

Apologies for the radio silence! I will double-check this evening and update this thread if the issue persists.

journeytogether commented 3 months ago

Just to update, I have redeployed this morning using your YAML, above, and then accessing on http://host-ip:83/live.html. This now does indeed load HamClock, thank you!

It must have been down to missing the version declaration in the docker-compose.yaml file, though, I'm at a loss to explain why this prevented the container starting at all.

Thank you @ChrisRomp for jumping on this and helping out. Much appreciated.