Add nextcloud

This commit is contained in:
Gal 2023-12-25 12:27:42 +01:00
parent b322ee2572
commit cda1e2efa5
1 changed files with 56 additions and 0 deletions

View File

@ -0,0 +1,56 @@
version: '3.2'
services:
db:
image: postgres:14.5
restart: always
volumes:
- ${PWD}/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:latest
restart: always
ports:
- "100.104.163.2:8080:80"
volumes:
- ${PWD}/nextcloud:/var/www/html
- /mnt/nextcloud_data:/var/www/html/data
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: /etc/secure_config/.nextcloud_admin_password.txt # put admin password in this file
nextcloud_admin_user:
file: /etc/secure_config/.nextcloud_admin_user.txt # put admin username in this file
postgres_db:
file: /etc/secure_config/.postgres_db.txt # put postgresql db name in this file
postgres_password:
file: /etc/secure_config/.postgres_password.txt # put postgresql password in this file
postgres_user:
file: /etc/secure_config/.postgres_user.txt # put postgresql username in this file