Nextcloud docker second container not working

Hello ,
i am using the example from
“docker/examples/docker-compose/with-nginx-proxy/mariadb/apache”
with letsencrypt and reverse proxy containers. If i run the example, it is working, i can access the Nextcloud from the web using https on my host that i specified in the docker-compose.yml

Now, i would like to run a second Nextcloud Instance and checked the documentation of the reverse proxy and letsencrypt containers (it should be quite simple, just having the hosts specified). I reused the docker-compose.yml file from the example above and only used the app and db sections AND used a different Host for this container. If i start the container, i see that the letsencrypt container is creating the certificate . BUT if i put the host name in my browser i get “502 Bad Gateway”.

I did also try to setup only the containers for reverse proxy + letsencrypt and afterwards start the nextcloud and database containers. Also then, it does not work. if i run everything together from the example, it works.

  • How can i run more nextcloud instances that i can access correctly from internet?
  • what is the difference in running the example at once or in steps (reverse proxy+letsencrypt, then nextcloud+database)

I am thankful for any hints, i am trying for several weeks now without any success on this!

Kind Regards
Matthias

Here are my running containers:

Docker-compose.yml for second Nextcloud :

Docker-compose.yml for the example:
i can only update 2 pictures

Error Message:
i can only update 2 pictures
working nextcloud from example:
i can only update 2 pictures

Docker-compose.yml for the example:


Error Message:

working nextcloud from example:

could you please copy the docker-compose files as text quoted with tree ```. that’s much easier to read.

may guess why you failed with your second container pair: you didn’t rename the volumes. so two database container use the same database files.

p.s.: my playbook can do the trick.

Hello Reiner,

thank you very much for your answer! I did change the names as you mentioned.

I found out, that i have to do the “docker-compose up -d” command for the second instance in the same folder as for the first instance. I dont know exactly why, but it seems to make it work.

Thanks
Matthias