Skip to content

Commit e422a1b

Browse files
docs(readme): add docker compose equivalents for apache and fpm quickstarts
Add collapsible Docker Compose examples alongside existing `docker run` commands in the "Using the apache image" and "Using the fpm image" sections, using <details> blocks to avoid bloating the page. The FPM example includes the required nginx service and links to the Nextcloud nginx documentation and the existing FPM examples in this repository for a working nginx.conf. Docker Compose equivalents for the "Persistent data" and "Additional volumes" sections are deferred pending the merge of #2566. Signed-off-by: Josh <josh.t.richards@gmail.com>
1 parent 17c2c59 commit e422a1b

1 file changed

Lines changed: 60 additions & 5 deletions

File tree

README.md

Lines changed: 60 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,25 +80,80 @@ For the image specifically, we provide [some simple deployment examples](https:/
8080
Below you'll find the main documentation for using this image.
8181

8282
## Using the apache image
83+
8384
The apache image contains a webserver and exposes port 80. To start the container type:
8485

8586
```console
86-
$ docker run -d -p 8080:80 nextcloud
87+
$ docker run -d -p 8080:80 nextcloud:stable-apache
8788
```
8889

90+
<details>
91+
<summary>Docker Compose equivalent</summary>
92+
93+
```yaml
94+
# compose.yaml
95+
services:
96+
app:
97+
image: nextcloud:stable-apache
98+
restart: always
99+
ports:
100+
- 8080:80
101+
```
102+
103+
```console
104+
$ docker compose up -d
105+
```
106+
107+
</details>
108+
89109
Now you can access Nextcloud at http://localhost:8080/ from your host system.
90110

91-
WARNING: This example is only suitable for limited testing purposes. Please read on to understand how the image handles storing your data and other aspects you need to consider to establish a full Nextcloud stack.
111+
WARNING: This example is only suitable for limited testing purposes. Please read on to understand how the image handles storing your data and other aspects you need to consider to establish a full Nextcloud deployment.
92112

93113

94114
## Using the fpm image
95-
To use the fpm image, you need an additional web server, such as [nginx](https://docs.nextcloud.com/server/latest/admin_manual/installation/nginx.html), that can proxy http-request to the fpm-port of the container. For fpm connection this container exposes port 9000. In most cases, you might want to use another container or your host as proxy. If you use your host you can address your Nextcloud container directly on port 9000. If you use another container, make sure that you add them to the same docker network (via `docker run --network <NAME> ...` or a `docker compose` file). In both cases you don't want to map the fpm port to your host.
115+
116+
To use the fpm image, you need an additional web server, such as [nginx](https://docs.nextcloud.com/server/latest/admin_manual/installation/nginx.html), that can proxy http-request to the fpm-port of the container. For the connection between the fpm-container and the webserver-container you can use the default docker network or create your own.
96117

97118
```console
98-
$ docker run -d nextcloud:fpm
119+
$ docker run -d nextcloud:stable-fpm
120+
```
121+
122+
<details>
123+
<summary>Docker Compose equivalent</summary>
124+
125+
```yaml
126+
# compose.yaml
127+
services:
128+
app:
129+
image: nextcloud:stable-fpm
130+
restart: always
131+
volumes:
132+
- nextcloud:/var/www/html
133+
134+
web:
135+
image: nginx:alpine-slim
136+
restart: always
137+
ports:
138+
- 8080:80
139+
depends_on:
140+
- app
141+
volumes:
142+
- ./nginx.conf:/etc/nginx/nginx.conf:ro
143+
volumes_from:
144+
- app
145+
146+
volumes:
147+
nextcloud:
99148
```
100149
101-
As the fastCGI-Process is not capable of serving static files (style sheets, images, ...), the webserver needs access to these files. This can be achieved with the `volumes-from` option. You can find more information in the [docker compose section](#running-this-image-with-docker-compose).
150+
See [Base version - FPM](#base-version---fpm) for a complete example including a database and Redis.
151+
152+
**Note:** You will need to provide an `nginx.conf` file. See the [Nextcloud nginx documentation](https://docs.nextcloud.com/server/latest/admin_manual/installation/nginx.html) for the recommended configuration, and the [FPM examples](https://github.com/nextcloud/docker/tree/master/.examples/docker-compose/insecure/postgres/fpm) in this repository for a working sample.
153+
154+
</details>
155+
156+
As the fastCGI-Process is not capable of serving static files (style sheets, images, ...), the webserver needs access to these files. This can be achieved with the `volumes-from` option. You can find more information in the docker documentation, for example in the [Building a first-class app](https://docs.docker.com/engine/tutorials/dockerlinks/) section.
102157

103158
## Using an external database
104159
By default, this container uses SQLite for data storage but the Nextcloud setup wizard (appears on first run) allows connecting to an existing MySQL/MariaDB or PostgreSQL database. You can also link a database container, e. g. `--link my-mysql:mysql`, and then use `mysql` as the database host on setup. More info is in [the docker compose section](https://github.com/nextcloud/docker/?tab=readme-ov-file#running-this-image-with-docker-compose).

0 commit comments

Comments
 (0)