mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-19 22:16:49 +00:00
Merge pull request #2643 from nextcloud/composeyaml
reaname compose file to compose.yaml
This commit is contained in:
commit
c14fa9d4b4
7 changed files with 20 additions and 23 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -6,4 +6,5 @@
|
|||
/manual-install/*.conf
|
||||
!/manual-install/sample.conf
|
||||
/manual-install/docker-compose.yml
|
||||
/manual-install/compose.yaml
|
||||
/manual-install/.env
|
||||
|
|
|
|||
|
|
@ -1,9 +1,3 @@
|
|||
version: "3.8"
|
||||
|
||||
volumes:
|
||||
nextcloud_aio_mastercontainer:
|
||||
name: nextcloud_aio_mastercontainer # This line is not allowed to be changed as otherwise the built-in backup solution will not work
|
||||
|
||||
services:
|
||||
nextcloud:
|
||||
image: nextcloud/all-in-one:latest
|
||||
|
|
@ -51,6 +45,10 @@ services:
|
|||
# - ./sites:/srv
|
||||
# network_mode: "host"
|
||||
|
||||
volumes:
|
||||
nextcloud_aio_mastercontainer:
|
||||
name: nextcloud_aio_mastercontainer # This line is not allowed to be changed as otherwise the built-in backup solution will not work
|
||||
|
||||
# # Optional: If you need ipv6, follow step 1 and 2 of https://github.com/nextcloud/all-in-one/blob/main/docker-ipv6-support.md first and then uncomment the below config in order to activate ipv6 for the internal nextcloud-aio network.
|
||||
# # Please make sure to uncomment also the networking lines of the mastercontainer above in order to actually create the network with docker-compose
|
||||
# # Inspired by https://github.com/mailcow/mailcow-dockerized/blob/master/docker-compose.yml
|
||||
|
|
@ -9,7 +9,7 @@ You can run AIO with docker rootless by following the steps below.
|
|||
1. Also do not forget to run `loginctl enable-linger USERNAME` (and substitute USERNAME with the correct one) in order to make sure that user services are automatically started after every reboot.
|
||||
1. Expose the privileged ports by following https://docs.docker.com/engine/security/rootless/#exposing-privileged-ports. (`sudo setcap cap_net_bind_service=ep $(which rootlesskit); systemctl --user restart docker`)
|
||||
1. Use the official AIO startup command but use `--volume $XDG_RUNTIME_DIR/docker.sock:/var/run/docker.sock:ro` instead of `--volume /var/run/docker.sock:/var/run/docker.sock:ro` and also add `--env WATCHTOWER_DOCKER_SOCKET_PATH=$XDG_RUNTIME_DIR/docker.sock` to the initial container startup (which is needed for mastercontainer updates to work correctly).
|
||||
1. Now everything should work like without docker rootless. You can consider using docker-compose for this or running it behind a reverse proxy. Basically the only thing that needs to be adjusted always in the startup command or docker-compose file (after installing docker rootles) are things that are mentioned in point 3.
|
||||
1. Now everything should work like without docker rootless. You can consider using docker-compose for this or running it behind a reverse proxy. Basically the only thing that needs to be adjusted always in the startup command or compose.yaml file (after installing docker rootles) are things that are mentioned in point 3.
|
||||
|
||||
**Please note:** All files outside the containers get created, written to and accessed as the user that is running the docker daemon or a subuid of it. So for the built-in backup to work you need to allow this user to write to the target directory. E.g. with `sudo chown -R USERNAME:GROUPNAME /mnt/backup`. The same applies when changing Nextcloud's datadir. E.g. `sudo chown -R USERNAME:GROUPNAME /mnt/ncdata`. When you want to use the NEXTCLOUD_MOUNT option for local external storage, you need to adjust the permissions of the chosen folders to be accessible/writeable by the userid `100032:100032` (if running `grep ^$(whoami): /etc/subuid` as the user that is running the docker daemon returns 100000 as first value).
|
||||
|
||||
|
|
|
|||
|
|
@ -11,19 +11,19 @@ You can run the containers that are build for AIO with docker-compose. This come
|
|||
- You lose the AIO interface
|
||||
- You lose update notifications and automatic updates
|
||||
- You lose all AIO backup and restore features
|
||||
- **You need to know what you are doing, especially when modifying the docker-compose file**
|
||||
- **You need to know what you are doing, especially when modifying the compose.yaml file**
|
||||
- For updating, you need to strictly follow the at the bottom described update routine
|
||||
- Probably more
|
||||
|
||||
## How to use this?
|
||||
First, install docker and docker-compose if not already done. Then simply run the following:
|
||||
First, install docker and docker-compose (v2) if not already done. Then simply run the following:
|
||||
```bash
|
||||
git clone https://github.com/nextcloud/all-in-one.git
|
||||
cd all-in-one/manual-install
|
||||
```
|
||||
Then copy the sample.conf to default environment file, e.g. `cp sample.conf .env`, open the new conf file, e.g. with `nano .env`, edit all values that are marked with `# TODO!`, close and save the file. (Note: there is no clamav image for arm64).
|
||||
|
||||
Now copy the provided yaml file to a docker-compose file by running `cp latest.yml docker-compose.yml`.
|
||||
Now copy the provided yaml file to a compose.yaml file by running `cp latest.yml compose.yaml`.
|
||||
|
||||
Now you should be ready to go with `sudo docker-compose up`.
|
||||
|
||||
|
|
@ -34,10 +34,11 @@ For a complete all-in-one with collabora use `sudo docker-compose --profile coll
|
|||
|
||||
## How to update?
|
||||
Since the AIO containers may change in the future, it is highly recommended to strictly follow the following procedure whenever you want to upgrade your containers.
|
||||
1. If your previous copy of `sample.conf` is named `my.conf`, run `mv my.conf .env` in order to rename the file to `.env`.
|
||||
1. If your previous copy of `sample.conf` is named `my.conf`, run `mv -vn my.conf .env` in order to rename the file to `.env`.
|
||||
1. Run `sudo docker-compose down` to stop all running containers
|
||||
1. Back up all important files and folders
|
||||
1. Run `git pull` in order to get the updated yaml files from the repository. Now bring your `docker-compose.yml` file up-to-date with the updated one from the repository. You can use `diff docker-compose.yml latest.yml` for comparing. ⚠️ **Please note**: Starting with AIO v5.1.0, ipv6 networking will be enabled by default, so make sure to either enable it first by following steps 1 and 2 of https://github.com/nextcloud/all-in-one/blob/main/docker-ipv6-support.md and then proceed with the steps below or disable ipv6 networking by editing the docker-compose file and removing ipv6 from the network.
|
||||
1. If your compose file is still named `docker-compose.yml` rename it to `compose.yaml` by running `mv -vn docker-compose.yml compose.yaml`
|
||||
1. Run `git pull` in order to get the updated yaml files from the repository. Now bring your `compose.yaml` file up-to-date with the updated one from the repository. You can use `diff compose.yaml latest.yml` for comparing. ⚠️ **Please note**: Starting with AIO v5.1.0, ipv6 networking will be enabled by default, so make sure to either enable it first by following steps 1 and 2 of https://github.com/nextcloud/all-in-one/blob/main/docker-ipv6-support.md and then proceed with the steps below or disable ipv6 networking by editing the compose.yaml file and removing ipv6 from the network.
|
||||
1. Also have a look at the `sample.conf` if any variable was added or renamed and add that to your conf file as well. Here may help the diff command as well.
|
||||
1. After the file update was successful, simply run `sudo docker-compose pull` to pull the new images.
|
||||
1. At the end run `sudo docker-compose up` in order to start and update the containers with the new configuration.
|
||||
|
|
|
|||
|
|
@ -119,10 +119,7 @@ done
|
|||
|
||||
OUTPUT="$(echo "$OUTPUT" | sed "/restart: /a\ \ \ \ networks:\n\ \ \ \ \ \ - nextcloud-aio")"
|
||||
|
||||
echo 'version: "3.8"' > containers.yml
|
||||
echo "" >> containers.yml
|
||||
|
||||
echo "$OUTPUT" >> containers.yml
|
||||
echo "$OUTPUT" > containers.yml
|
||||
|
||||
sed -i '/container_name/d' containers.yml
|
||||
sed -i 's|^ $||' containers.yml
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ Included are:
|
|||
- Can be used with [Docker rootles](https://github.com/nextcloud/all-in-one/blob/main/docker-rootless.md) (good for additional security)
|
||||
- Runs on all platforms Docker supports (e.g. also on Windows and Macos)
|
||||
- Included containers easy to debug by having the possibility to check their logs directly from the AIO interface
|
||||
- [Docker-compose ready](https://github.com/nextcloud/all-in-one/blob/main/docker-compose.yml)
|
||||
- [Docker-compose ready](./compose.yaml)
|
||||
- Can be installed [without a container having access to the docker socket](https://github.com/nextcloud/all-in-one/tree/main/manual-install)
|
||||
- Can be installed with [Docker Swarm](https://github.com/nextcloud/all-in-one#can-i-run-this-with-docker-swarm)
|
||||
- Can be installed with [Kubernetes](https://github.com/nextcloud/all-in-one/tree/main/nextcloud-aio-helm-chart)
|
||||
|
|
@ -108,7 +108,7 @@ The following instructions are meant for installations without a web server or r
|
|||
- `--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config` This means that the files that are created by the mastercontainer will be stored in a docker volume that is called `nextcloud_aio_mastercontainer`. This line is not allowed to be changed, since built-in backups would fail later on.
|
||||
- `--volume /var/run/docker.sock:/var/run/docker.sock:ro` The docker socket is mounted into the container which is used for spinning up all the other containers and for further features. It needs to be adjusted on Windows/macOS and on docker rootless. See the applicable documentation on this. If adjusting, don't forget to also set `WATCHTOWER_DOCKER_SOCKET_PATH`! If you dislike this, see https://github.com/nextcloud/all-in-one/tree/main/manual-install.
|
||||
- `nextcloud/all-in-one:latest` This is the docker container image that is used.
|
||||
- Further options can be set using environment variables, for example `--env NEXTCLOUD_DATADIR="/mnt/ncdata"` (This is an example for Linux. See [this](https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir) for other OS' and for an explanation of what this value does. This specific one needs to be specified upon the first startup if you want to change it to a specific path instead of the default Docker volume). To see explanations and examples for further variables (like changing the location of Nextcloud's datadir or mounting some locations as external storage into the Nextcloud container), read through this readme and look at the docker-compose file: https://github.com/nextcloud/all-in-one/blob/main/docker-compose.yml
|
||||
- Further options can be set using environment variables, for example `--env NEXTCLOUD_DATADIR="/mnt/ncdata"` (This is an example for Linux. See [this](https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir) for other OS' and for an explanation of what this value does. This specific one needs to be specified upon the first startup if you want to change it to a specific path instead of the default Docker volume). To see explanations and examples for further variables (like changing the location of Nextcloud's datadir or mounting some locations as external storage into the Nextcloud container), read through this readme and look at the docker-compose file: https://github.com/nextcloud/all-in-one/blob/main/compose.yaml
|
||||
</details>
|
||||
|
||||
Note: You may be interested in adjusting Nextcloud’s datadir to store the files in a different location than the default docker volume. See [this documentation](https://github.com/nextcloud/all-in-one#how-to-change-the-default-location-of-nextclouds-datadir) on how to do it.
|
||||
|
|
@ -190,7 +190,7 @@ If you have the NAS setup on your local network (which is most often the case) y
|
|||
</details>
|
||||
|
||||
### How to run AIO with Portainer?
|
||||
The easiest way to run it with Portainer on Linux is to use Portainer's stacks feature and use [this docker-compose file](./docker-compose.yml) in order to start AIO correctly.
|
||||
The easiest way to run it with Portainer on Linux is to use Portainer's stacks feature and use [this docker-compose file](./compose.yaml) in order to start AIO correctly.
|
||||
|
||||
### Notes on Cloudflare (proxy/tunnel)
|
||||
- Using Cloudflare Tunnel potentially slows down Nextcloud by a lot since local access via the configured domain is not possible since TLS proxying is in that case offloaded to Cloudflares infrastructure. You can fix this by setting up your own reverse proxy that handles TLS proxying locally.
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ https://<your-nc-domain>:443 {
|
|||
reverse_proxy localhost:11000
|
||||
}
|
||||
```
|
||||
The Caddyfile is a text file called `Caddyfile` (no extension) which – if you should be running Caddy inside a container – should usually be created in the same location as your `docker-compose.yml` file prior to starting the container.
|
||||
The Caddyfile is a text file called `Caddyfile` (no extension) which – if you should be running Caddy inside a container – should usually be created in the same location as your `compose.yaml` file prior to starting the container.
|
||||
|
||||
Of course you need to modify `<your-nc-domain>` to the domain on which you want to run Nextcloud. Also make sure to adjust the port 11000 to match the chosen `APACHE_PORT`. **Please note:** The above configuration will only work if your reverse proxy is running directly on the host that is running the docker daemon. If the reverse proxy is running in a docker container, you can use the `--network host` option (or `network_mode: host` for docker-compose) when starting the reverse proxy container in order to connect the reverse proxy container to the host network. ***If that is not an option or not possible for you (like e.g. on Windows or if the reverse proxy is running on a different host), you can alternatively instead of `localhost` use the private ip-address of the host that is running the docker daemon. If you are not sure how to retrieve that, you can run: `ip a | grep "scope global" | head -1 | awk '{print $2}' | sed 's|/.*||'`. If the command returns a public ip-address, use `ip a | grep "scope global" | grep docker0 | awk '{print $2}' | sed 's|/.*||'` instead (the commands only work on Linux)***
|
||||
|
||||
|
|
@ -339,7 +339,7 @@ Apart from that, there is this: [manual-install](https://github.com/nextcloud/al
|
|||
|
||||
<summary>click here to expand</summary>
|
||||
|
||||
First, please make sure that the environmental variables `PUID` and `PGID` in the docker-compose.yml file for NPM are either unset or set to `0`.
|
||||
First, please make sure that the environmental variables `PUID` and `PGID` in the compose.yaml file for NPM are either unset or set to `0`.
|
||||
|
||||
Second, see these screenshots for a working config:
|
||||
|
||||
|
|
@ -568,7 +568,7 @@ Config examples for other reverse proxies are currently not documented. Pull req
|
|||
|
||||
After adjusting your reverse proxy config, use the following command to start AIO:<br>
|
||||
|
||||
(For an docker-compose example, see the example further [below](#inspiration-for-a-docker-compose-file).)
|
||||
(For a docker-compose example, see the example further [below](#inspiration-for-a-docker-compose-file).)
|
||||
|
||||
```
|
||||
# For Linux:
|
||||
|
|
@ -617,7 +617,7 @@ On Synology DSM see https://github.com/nextcloud/all-in-one#how-to-run-aio-on-sy
|
|||
|
||||
### Inspiration for a docker-compose file
|
||||
|
||||
Simply translate the docker run command into a docker-compose file. You can have a look at [this file](https://github.com/nextcloud/all-in-one/blob/main/docker-compose.yml) for some inspiration but you will need to modify it either way. You can find further examples here: https://github.com/nextcloud/all-in-one/discussions/588
|
||||
Simply translate the docker run command into a docker-compose file. You can have a look at [this file](https://github.com/nextcloud/all-in-one/blob/main/compose.yaml) for some inspiration but you will need to modify it either way. You can find further examples here: https://github.com/nextcloud/all-in-one/discussions/588
|
||||
|
||||
## 3. Limit the access to the apache container
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue