I have a ‘master’ container, that should be already running when starting all the others.
In it i have a
conf/ directory, that this service is monitoring and applying the relevant changes.
How can i have each new container drop a file in this directory?
docker-compose.yml below, i want each service (
apache) to drop a
.yml file in the
"./traefik/conf/:/etc/traefik/conf/" path mapping of the
version: "3.5" services: traefik: image: traefik env_file: ./traefik/env restart: unless-stopped ports: - "80:80" - "443:443" - "8080:8080" volumes: - /var/run/docker.sock:/var/run/docker.sock - ./traefik/conf/:/etc/traefik/conf/ - ./traefik/traefik.yml:/etc/traefik/traefik.yml portainer: image: portainer/portainer depends_on: [traefik] command: --no-auth -H unix:///var/run/docker.sock volumes: - /var/run/docker.sock:/var/run/docker.sock whoami: image: containous/whoami depends_on: [traefik]
http: routers: portainer: entryPoints: [http] middlewares: [redirect-to-http] service: portainer-preauth@docker rule: Host(`portainer.docker.mydomain`)
http: routers: whoami: entryPoints: [http] middlewares: [redirect-to-http] service: whoami-preauth@docker rule: Host(`whoami.docker.mydomain`)
If they are on host machine, why not just directly copy them to ./traefik/conf/ ?
the thing is i cant have all files in
this would require manually dropping a file there every time i create a new image.
i believe that every service should be responsible for its own files.
traefik starts and finds files of those other services that haven’t started yet, it logs lots of errors.
to avoid this behavior, i would like to put the file there only when the container is started.
below is is the project file structure.