Multiple docker containers on same server
asoral opened this issue · 1 comments
I might be missing something but please help me understand this. I am trying to use this script to install nextcloud and it works just fine for the first time. Now, I want to use the same script, on the same VM and install another docker for nextcloud. My questions -
- What all values should I change in what all files to make this happen?
- Where is it defined that the port number for nextcloud is 80 and that of ssl is 443. Can I change this and have multiple containers running on the same machine?
Please help me here!
2\. Where is it defined that the port number for nextcloud is 80 and that of ssl is 443.
That is defined in the traefik.toml line 6 & 11.
2\. Can I change this and have multiple containers running on the same machine?
With a lot of work. Maybe.
If you want to run different nextcloud instances on different ports you have to define for each one another entrypoint. Like it's done for onlyoffice.
So traefik will listen on all these ports. That's the easy part.
Now you have to find all container tasks needed to setup a nextcloud instance.
That is at least nextcloud + nginx (in case you use the fpm container).
You have to give the container different namens (nextcloud00, nextcloud01, nextcloud02, ...)
You have to make sure that they all use different data and config folders
and you have to modify the config tasks.
as you can see in the command above the container name is always "nextcloud".
When I was writing this playbook I didn't had a multi nextcloud environment in mind.
The good news: You look at the playbook ReinerNippes/selfhosted_on_docker.
There you can define a set of nextcloud instances.
- name: nextcloud00
type: nextcloud
server_fqdn: nextcloud00.{{ base_domain }}
collabora: true
collabora_dictionaries: "de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru"
onlyoffice: true
talk: true
talk_server: base.{{ base_domain }}
- name: nextcloud01
type: nextcloud
server_fqdn: nextcloud01.{{ base_domain }}
collabora: true
collabora_dictionaries: "de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru"
onlyoffice: true
talk: true
talk_server: base.{{ base_domain }}
- name: nextcloud02
type: nextcloud
server_fqdn: nextcloud02.{{ base_domain }}
collabora: true
collabora_dictionaries: "de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru"
onlyoffice: true
talk: true
talk_server: base.{{ base_domain }}
Nevertheless they won't run on different ports but different dns names.