ReinerNippes / nextcloud_on_docker

Run Nextcloud in Docker Container on various Linux Hosts
MIT License
203 stars 48 forks source link

Label question #30

Closed ghost closed 4 years ago

ghost commented 4 years ago

Hi,

How come some of the containers such as adminer contain traefik labels and the Nextcloud container does not?

ReinerNippes commented 4 years ago

The nextcloud container is a bit tricky. There two kind of images: apache and fpm-php The fpm-php image has no build in web server. So it only works with a web server (nginx) in front of it.
Traefik is not a web server. It's only a reverse proxy/ingress router.

So I hat to put the labels in a variable.

https://github.com/ReinerNippes/nextcloud_on_docker/blob/f7a88d8099ade0e6f4699f6a2eb9e41d875ba309/roles/docker_container/vars/main.yml#L4

If fpm is part of the image name the nextcloud container has no labels

https://github.com/ReinerNippes/nextcloud_on_docker/blob/f7a88d8099ade0e6f4699f6a2eb9e41d875ba309/roles/docker_container/tasks/nextcloud.yml#L46

but the nginx container has them

https://github.com/ReinerNippes/nextcloud_on_docker/blob/f7a88d8099ade0e6f4699f6a2eb9e41d875ba309/roles/docker_container/tasks/nginx.yml#L35

ghost commented 4 years ago

Ahhh I see. Perfect explanation. Thanks!