Hello,
I have installed a Traefik server with Docker which works fine and I have deployed my nodejs app, and configured the container which works fine too (app.mydomain.com).
The things is that I start new docker-compose stacks on same network but urls are accessible randomly: tool1.mydomain.com, tool2.mydomain.com.
Here is the traefik conf (I hide all passwords and keys):
version: '3'
services:
traefik:
image: "traefik:v2.6"
command:
- "--log.level=DEBUG"
- "--providers.docker=true"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
ports:
- "80:80"
- "443:443"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- ./certs-traefik.yaml:/etc/traefik/dynamic/certs-traefik.yaml
- ./certs:/etc/certs/
environment:
- CF_API_EMAIL=contact@bridgeit.fr
- CF_API_KEY=MYKEY
labels:
- "traefik.enable=true"
- "traefik.http.routers.api.service=api@internal"
- "traefik.http.routers.api.entrypoints=websecure"
- "traefik.http.routers.api.tls=true"
- "traefik.http.routers.api.middlewares=auth"
- "traefik.http.middlewares.auth.basicauth.users=admin:{SHA}/XXXXXXXX"
networks:
- app
networks: #TAG_INCLUDE_NETWORKS
app:
external: true
The app conf:
node:
image: app-node
container_name: app-node
restart: always
env_file:
- ./.env
build: .
volumes:
- ./app:/src/app
- ./dockerEnv:/src/app/dockerEnv
- ./tasks:/src/app/tasks:rw
ports:
- "3000:3000"
networks:
- app
labels:
- "traefik.enable=true"
- "traefik.http.routers.mainApp.rule=Host(`app.mydomain.com`)"
- "traefik.http.routers.mainApp.entrypoints=websecure"
- "traefik.http.routers.mainApp.tls=true"
- "traefik.http.services.mainApp.loadbalancer.server.port=3000"
And here is one service which works fine 10 seconds and after, the web navigator hangs:
phpmyadmin:
image: phpmyadmin
container_name: phpmyadmin
expose:
- 8080
env_file:
- ./.env
environment:
- UPLOAD_LIMIT=200M
restart: always
networks:
- 9nnqShIyYyboVuFH
- app
labels:
- "traefik.enable=true"
- "traefik.http.routers.pma9nnqshiyyybovufh.rule=Host(`pma.magentodocker.com`)"
- "traefik.http.routers.pma9nnqshiyyybovufh.entrypoints=websecure"
- "traefik.http.routers.pma9nnqshiyyybovufh.tls=true"
- "traefik.http.services.pma9nnqshiyyybovufh.loadbalancer.server.port=80"
I also deploy a dozzle and another app, but it's the same results.
Thanks a lot for your help, I am quite stucked