BadApple9 / speedtest-x

A self-hosted speedtest appilication with an awesome test result datasheet.
GNU Lesser General Public License v2.1
1.76k stars 409 forks source link

traefik部署访问失败 #59

Open hehe9011 opened 11 months ago

hehe9011 commented 11 months ago

部署环境: Ubuntu 22.04.3 LTS

使用docker compose 部署:

version: '3.9' services: speedtest-x: image: badapple9/speedtest-x container_name: speedtest restart: unless-stopped tty: true stdin_open: true networks:

  • traefik ports:
  • '9011:80' labels: traefik.enable: true traefik.docker.network: traefik traefik.http.routers.speedtest.rule: Host(speedtest.*.cn) traefik.http.routers.speedtest.tls: true traefik.http.routers.speedtest.tls.certresolver: myresolver traefik.http.services.speedtest.loadbalancer.server.port: 9011

networks: traefik: external: true

无法访问,显示404 page not found, docker log如下:

  • cp /speedtest/speedtest.js /speedtest/speedtest_worker.js /var/www/html/
  • cp /speedtest/chart.html /speedtest/index.html /speedtest/results.html /var/www/html/
  • cp -r /speedtest/backend/ /var/www/html/backend
  • cp -r /speedtest/chartjs/ /var/www/html/chartjs
  • ln -snf /var/www/html/backend/speedlogs /speedlogs
  • chown -R www-data /var/www/html/backend /var/www/html/chart.html /var/www/html/chartjs /var/www/html/index.html /var/www/html/results.html /var/www/html/speedtest.js /var/www/html/speedtest_worker.js
  • '[' 80 '!=' 80 ']'
  • '[' 100 '!=' 100 ']'
  • '[' ip.sb '!=' ip.sb ']'
  • '[' false '!=' false ']'
  • echo 'Done, Starting APACHE' Done, Starting APACHE
  • apache2-foreground AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.26.0.7. Set the 'ServerName' directive globally to suppress this message AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.26.0.7. Set the 'ServerName' directive globally to suppress this message [Sat Dec 16 11:30:24.954697 2023] [mpm_prefork:notice] [pid 13] AH00163: Apache/2.4.54 (Debian) PHP/7.4.33 configured -- resuming normal operations [Sat Dec 16 11:30:24.954752 2023] [core:notice] [pid 13] AH00094: Command line: 'apache2 -D FOREGROUND'
WPF0414 commented 8 months ago

兄弟,traefik.http.services.speedtest.loadbalancer.server.port是容器的端口,而不是宿主机。

tankren commented 1 month ago

下面的是我的,正常使用

speedtest-x:
image: dockerproxy.net/badapple9/speedtest-x:latest
container_name: speedtest-x
environment:
  - SAME_IP_MULTI_LOGS=true
ports:
  - 9001:80
#network_mode: host
restart: unless-stopped
labels:
    - "traefik.enable=true"
    - "traefik.port=9001"
    - "traefik.http.routers.speedtest-x.rule=Host(`speedtest-x.domain.com`)"
    - "traefik.http.routers.speedtest-x.entrypoints=websecure"
    - "traefik.http.routers.speedtest-x.tls.certresolver=letsencrypt"
    - 'traefik.http.routers.speedtest-x.middlewares=authelia@docker'
networks:
  - "traefik_net"