Added docker-compose and notes for nextcloud

This commit is contained in:
Michele Cereda
2022-05-11 22:42:36 +02:00
parent b13a3849c2
commit 72a54132a3
2 changed files with 62 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
# Nextcloud docker image
## Sources
- [Docker Hub]
[docker hub]: https://hub.docker.com/_/nextcloud

View File

@@ -0,0 +1,55 @@
version: '3.2'
services:
db:
image: postgres
restart: always
volumes:
- db:/var/lib/postgresql/data
environment:
- POSTGRES_DB_FILE=/run/secrets/postgres_db
- POSTGRES_USER_FILE=/run/secrets/postgres_user
- POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password
secrets:
- postgres_db
- postgres_password
- postgres_user
app:
image: nextcloud
restart: always
ports:
- 8080:80
volumes:
- nextcloud:/var/www/html
environment:
- POSTGRES_HOST=db
- POSTGRES_DB_FILE=/run/secrets/postgres_db
- POSTGRES_USER_FILE=/run/secrets/postgres_user
- POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password
- NEXTCLOUD_ADMIN_PASSWORD_FILE=/run/secrets/nextcloud_admin_password
- NEXTCLOUD_ADMIN_USER_FILE=/run/secrets/nextcloud_admin_user
depends_on:
- db
secrets:
- nextcloud_admin_password
- nextcloud_admin_user
- postgres_db
- postgres_password
- postgres_user
volumes:
db:
nextcloud:
secrets:
nextcloud_admin_password:
file: ./nextcloud_admin_password.txt
nextcloud_admin_user:
file: ./nextcloud_admin_user.txt
postgres_db:
file: ./postgres_db.txt
postgres_password:
file: ./postgres_password.txt
postgres_user:
file: ./postgres_user.txt