我试图设置一个独立的服务器,在前面运行带有traefik的硒化物,以获得https和基本功能。
我能够运行所有的东西,但是每次我尝试使用浏览器:[SERVICE_STARTUP_FAILED] [wait: http://172.17.0.2:4444 does not respond in 30s]
时都会出现这个错误
这是我的船坞-复合。Here:
version: '3'
volumes:
production_traefik: {}
networks:
default:
driver: bridge
services:
selenoid:
build:
context: .
dockerfile: ./compose/selenoid/Dockerfile
image: production_selenoid
container_name: selenoid
networks:
- default
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
command: ["-conf", "/etc/selenoid/browsers.json", "-video-output-dir", "/opt/selenoid/video", "-log-output-dir", "/opt/selenoid/logs"]
selenoid-ui:
image: "aerokube/selenoid-ui"
depends_on:
- selenoid
links:
- selenoid
networks:
- default
restart: unless-stopped
container_name: selenoid-ui
command: ["--selenoid-uri", "http://selenoid:4444"]
selenoid-chrome:
image: "selenoid/chrome:latest"
restart: unless-stopped
container_name: selenoid-chrome
networks:
- default
traefik:
build:
context: .
dockerfile: ./compose/traefik/Dockerfile
image: production_traefik
container_name: traefik
networks:
- default
depends_on:
- selenoid-ui
- selenoid
volumes:
- production_traefik:/etc/traefik/acme:z
ports:
- "0.0.0.0:80:80"
- "0.0.0.0:443:443"
- "0.0.0.0:4444:4444"
我的traefik.yml:
log:
level: INFO
entryPoints:
web:
# http
address: ":80"
http:
redirections:
entryPoint:
to: web-secure
web-secure:
# https
address: ":443"
hub:
address: ":4444"
certificatesResolvers:
letsencrypt:
acme:
email: "my@email.com"
storage: /etc/traefik/acme/acme.json
httpChallenge:
entryPoint: web
http:
routers:
web-secure-router:
rule: "Host(`selenoid.mydomain.com`)"
entryPoints:
- web-secure
service: ui
middlewares:
- basic-test-auth
tls:
certResolver: letsencrypt
hub-secure-router:
rule: "Host(`selenoid.mydomain.com`)"
entryPoints:
- hub
service: hub
middlewares:
- basic-test-auth
tls:
certResolver: letsencrypt
middlewares:
basic-test-auth:
basicAuth:
users:
- "test-user:$apr1$n1gqpoi0$nspcnDDaBpJiTCoT2WaSw1"
services:
ui:
loadBalancer:
servers:
- url: http://selenoid-ui:8080
hub:
loadBalancer:
servers:
- url: http://selenoid:4444
providers:
file:
filename: /etc/traefik/traefik.yml
watch: true
Traefik Dockerfile:
FROM traefik:v2.2.11
RUN mkdir -p /etc/traefik/acme \
&& touch /etc/traefik/acme/acme.json \
&& chmod 600 /etc/traefik/acme/acme.json
COPY ./compose/traefik/traefik.yml /etc/traefik
:
FROM aerokube/selenoid:latest-release
RUN mkdir -p /etc/selenoid
COPY ./compose/selenoid/browsers.json /etc/selenoid
browser.json:
{
"chrome": {
"default": "latest",
"versions": {
"latest": {
"image": "selenoid/chrome",
"port": "4444",
"tmpfs": {"/tmp":"size=512m"}
}
}
}
}
这是日志:
[INIT] [Loading configuration files...]
[INIT] [Loaded configuration from /etc/selenoid/browsers.json]
[INIT] [Video Dir: /opt/selenoid/video]
[INIT] [Logs Dir: /opt/selenoid/logs]
[INIT] [Your Docker API version is 1.41]
[INIT] [Listening on :4444]
[NEW_REQUEST] [test-user] [*.*.*.*, 172.19.0.5]
[NEW_REQUEST_ACCEPTED] [test-user] [*.*.*.*, 172.19.0.5]
[LOCATING_SERVICE] [chrome] [latest]
[USING_DOCKER] [chrome] [latest]
[CREATING_CONTAINER] [selenoid/chrome]
[STARTING_CONTAINER] [selenoid/chrome] [f5331d61628342d5900b7929f350af67a2457f8ba6e2f7c9c209227cc6e30a9c]
[CONTAINER_STARTED] [selenoid/chrome] [f5331d61628342d5900b7929f350af67a2457f8ba6e2f7c9c209227cc6e30a9c] [0.35s]
[REMOVING_CONTAINER] [f5331d61628342d5900b7929f350af67a2457f8ba6e2f7c9c209227cc6e30a9c]
[CONTAINER_REMOVED] [f5331d61628342d5900b7929f350af67a2457f8ba6e2f7c9c209227cc6e30a9c]
[SERVICE_STARTUP_FAILED] [wait: http://172.17.0.2:4444 does not respond in 30s]
有人知道我做错了什么吗?
发布于 2022-10-03 18:59:25
如果有人碰到同样的问题:
networks:
selenoidweb:
name: selenoidweb
driver: bridge
并在selenoid服务中使用以下命令:
command: ["-container-network", "selenoidweb", "-conf", "/etc/selenoid/browsers.json", "-video-output-dir", "/opt/selenoid/video", "-log-output-dir", "/opt/selenoid/logs"]
https://stackoverflow.com/questions/73927001
复制相似问题