Closed james-cook closed 4 years ago
Hi James,
the aim of this playbook is a fully automated install of nextcloud on docker with no prerequisite. Everything will installed.
prepare_system.sh will install ansible itself.
The playbook executes the following steps: https://github.com/ReinerNippes/nextcloud_on_docker/blob/f7a88d8099ade0e6f4699f6a2eb9e41d875ba309/nextdocker.yml#L7
It's not too complicate to understand the single steps. You have to look into each ../roles/
On a system with an existing installation you have be careful. The playbook itself has root power. If any change will conflict with your drupal installation you have to know how to fix it. Most likely you want to change to ports of the traefik container. I assume 80/443 are already in use.
Maybe in your situation it's better to do a manual installation via docker-compose.
If you have the chance to setup a new server with Ubuntu 18.04 you want to look at https://github.com/ReinerNippes/selfhosted_on_docker because you install also a drupal container and migrate the new machine. In this case you would always have a fall back.
Thanks very much for your reply. There's a great deal of information there! My "main" aim with this is to isolate php versions in particular.
You said on the page I mentioned:
each server/service in one container. web-server, php, database and nextcloud = 4 container.
I hope to learn from the way you are containerising your services :) I see your tasks install nginx. But I can't see the containerisation of php - am I missing it somewhere in your code?
Context: I have multiple installations of nextcloud (on apache)- around version 17 - and keeping Drupal and nextcloud from conflicting with each other over php versions and environment as "global" is challenging to say the least, Separation would provide great relief.
Separation would provide great relief.
that's the core feature of docker container.
Do you have any pointers on how to containerise php?
there are ready to use php container. In many different flavors. https://hub.docker.com/_/php if you have written your own php application that would be your base.
nextcloud and drupal are using this images as their base image. both apps are installed into these base images.
does the nginx container contain its own php?
I use the fpm-php based nextcloud container. fpm-php can't handle static html, css, script content. So it needs a frontend server for that. That's the purpose of the nginx container. if you change the nextcloud image from fpm-alpine to latest you won't get nginx startet. because the base image of "latest" is an apache mod-php container.
that is controlled here: https://github.com/ReinerNippes/nextcloud_on_docker/blob/f7a88d8099ade0e6f4699f6a2eb9e41d875ba309/roles/docker_container/tasks/main.yml#L37
in front of nginx/apache is traefik as a reverse proxy. the advandage is that it generates automatically letsencrypt or selfsigned certificates and can route your web traffic to different services.
here (nextcloud_on_docker) it's used to also provide portainer and adminer services. (if enabled in the inventory file.) i only need to tag the containers and they are reachable from outside via ssl.
https://github.com/ReinerNippes/selfhosted_on_docker is the next level. you can define a list of services (multiple joomlas) and they are automatically create for you. https://github.com/ReinerNippes/selfhosted_on_docker#some-more-apps it would be also possible to setup different joomla versions with this.
Thanks for your great feedback. Before trying this in production I'm going to spin up a basic 16.04 droplet and follow your instructions to see how everything works,
Newbie here so excuse the question if it's obvious. If docker is installed (via ansible playbook etc.) this could be mentioned in the Readme. If docker is not installed but is a prerequisite this could be mentioned in the Readme - and a pointer to installation given (would be useful)
Where to execute e.g.:
in the docker instance(?) or on the "containing" physical machine...
Context: I came here from https://help.nextcloud.com/t/how-to-migrate-from-existing-ubuntu-16-04-installation-to-docker/46664 My situation is "similar" I am trying to move a "traditional" non-container installation from ubuntu 16.04 to be "contained" (in this case on the same physical machine). Other existing software/services on the ubuntu machine should continue to function - e.g. there is an old Drupal installation on the machine etc. I am a docker newbie. I will not be using S3 or any other external storage.