LooLzzz / docking-station

253 stars 4 forks source link

Unable to connect to Web UI? #5

Closed shyonae closed 3 months ago

shyonae commented 3 months ago

HI, this is my compose:

x-default-conf: &default_conf
  restart: unless-stopped
  networks:
    - managementStackNetwork
    - socketProxyNetwork

...

x-environment: &environment
  PGID: ${PGID}
  PUID: ${PUID}
  TZ: ${TZ}
  DOCKER_HOST: dockerproxy

services:
  ## DOCKING STATION ##
  docking-station:
    image: loolzzz/docking-station:latest
    container_name: docking-station
    environment:
      <<: *environment
    <<: [*default_conf, *labels, *logging]
    volumes:
      - ${DOCKERCONFDIR}/docking-station/config:/config
      - ${DOCKERCONFDIR}/docking-station/data:/data
      - ${DOCKERCONFDIR}/docking-station/logs:/logs
      - /etc/localtime:/etc/localtime:ro
      - ${DOCKER_COMPOSE_DIR}:/mnt/compose-files
    ports:
      - 3046:3000
      - 3047:3001
...

As you can see, I don't mount the docker.sock directly for security reasons but instead use a proxy. Now, these are my container logs:

[WEB]    ▲ Next.js 14.1.0
[WEB]    - Local:        http://428e92121064:3000
[WEB]    - Network:      http://172.18.0.7:3000
[WEB]
[WEB]  ✓ Ready in 182ms
[SERVER] INFO     Using path src/app/api/main.py
[SERVER] INFO     Resolved absolute path /app/docking-station-app/src/app/api/main.py
[SERVER] INFO     Searching for package file structure from directories with __init__.py
[SERVER]          files
[SERVER] INFO     Importing from /app/docking-station-app/src/app
[SERVER]
[SERVER]  ╭─ Python package file structure ─╮
[SERVER]  │                                 │
[SERVER]  │  📁 api                         │
[SERVER]  │  ├── 🐍 __init__.py             │
[SERVER]  │  └── 🐍 main.py                 │
[SERVER]  │                                 │
[SERVER]  ╰─────────────────────────────────╯
[SERVER]
[SERVER] INFO     Importing module api.main
[SERVER] INFO     Found importable FastAPI app
[SERVER]
[SERVER]  ╭── Importable FastAPI app ──╮
[SERVER]  │                            │
[SERVER]  │  from api.main import app  │
[SERVER]  │                            │
[SERVER]  ╰────────────────────────────╯
[SERVER]
[SERVER] INFO     Using import string api.main:app
[SERVER]
[SERVER]  ╭─────────── FastAPI CLI - Production mode ───────────╮
[SERVER]  │                                                     │
[SERVER]  │  Serving at: http://0.0.0.0:3001                    │
[SERVER]  │                                                     │
[SERVER]  │  API docs: http://0.0.0.0:3001/docs                 │
[SERVER]  │                                                     │
[SERVER]  │  Running in production mode, for development use:   │
[SERVER]  │                                                     │
[SERVER]  │  fastapi dev                                        │
[SERVER]  │                                                     │
[SERVER]  ╰─────────────────────────────────────────────────────╯
[SERVER]
[SERVER] INFO:     Started server process [17]
[SERVER] INFO:     Waiting for application startup.
[SERVER] INFO:     Application startup complete.
[SERVER] INFO:     Uvicorn running on http://0.0.0.0:3001 (Press CTRL+C to quit)
[AUTO-UPDATER] INFO:     Auto updater is disabled
[AUTO-UPDATER] NODE_ENV=production sleep 5 && python -m src.app.api.auto_updater exited with code 0

When trying to access the Web UI on port 3046 as I mapped since port 3000 is in use, I get this: image

I can access any other container normally, also I can access the container at port 3047 and get a 404 error (probably because I'm making a wrong api request, but still, it connects.).

Any ideas?

PinguCloud commented 3 months ago

I also can't connect to the Web UI. In my case the special thing is that i use MacVLAN:

services: docking-station: image: loolzzz/docking-station container_name: docking-station restart: unless-stopped

environment:

#   - WEB_PORT=3000
#   - SERVER_PORT=3001
ports:
  - 3000:3000
networks:
    macvlan:
      ipv4_address: 192.168.1.125
volumes:
  - /data/docker/docking-station/config:/config
  - /data/docker/docking-station/data:/data
  - /data/docker/docking-station/logs:/logs
  - /var/run/docker.sock:/var/run/docker.sock
  - /etc/localtime:/etc/localtime:ro
  # you should add mount points for each containers' docker-compose file you intend on update using this tool
  # i usually put everything in a single neat folder under
  - /var/lib/docker/volumes/portainer_data/_data/compose:/mnt/compose-files

networks: macvlan: name: MVLAN-Server external: true

LooLzzz commented 3 months ago

@shyonae

Firstly,
take a look at https://github.com/LooLzzz/docking-station/issues/3#issuecomment-2227306845
regarding this line

      - ${DOCKER_COMPOSE_DIR}:/mnt/compose-files

Secondly, try removing 3047:3001 from the ports: section
Map only the webui port, the backend is not supposed to be mapped

Another option would be to set the WEB_PORT=3046 environment variable in compose,
and then map 3046:3046

LooLzzz commented 3 months ago

@PinguCloud

Please open a new issue with the complete logs,
I'll do my best to help although I'm not too familiar with the macvlan option