1st commit - refined 2019 cfg + AI made README (I despise writing docs so it was either letting AI write README or having none, sorry)
This commit is contained in:
107
docker/docker-compose.yml
Normal file
107
docker/docker-compose.yml
Normal file
@@ -0,0 +1,107 @@
|
||||
############################################################
|
||||
# #
|
||||
# ________ ___ #
|
||||
# / ____/ |/ / /\_/\ * #
|
||||
# / / / /|_/ / ( o.o ) #
|
||||
# / /___/ / / / > ^ < #
|
||||
# \____/_/ /_/ _| |_ #
|
||||
# #
|
||||
# Maria DB server + backup container for Nextcloud #
|
||||
# Author: Corrado Mulas <tlc(at)mulas.me> #
|
||||
# #
|
||||
# No rights reserved 2026 #
|
||||
# * lil' bastard fiber eater #
|
||||
############################################################
|
||||
|
||||
services:
|
||||
|
||||
db:
|
||||
container_name: nextcloud-db
|
||||
image: mariadb:${ENV_MARIADB_VERSION:-11.8-ubi9}
|
||||
volumes:
|
||||
- ${ENV_BASE_DIR}/mariadb/data:/var/lib/mysql
|
||||
- ${ENV_BASE_DIR}/mariadb/config:/etc/mysql/conf.d
|
||||
- ${ENV_BASE_DIR}/mariadb/socket:/var/run/mysqld
|
||||
networks:
|
||||
- nextcloud_cts
|
||||
ports:
|
||||
- "3306:3306"
|
||||
|
||||
restart: always
|
||||
secrets:
|
||||
- mysql_root_password
|
||||
- mysql_app_password
|
||||
|
||||
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/mysql_root_password
|
||||
- MYSQL_PASSWORD_FILE=/run/secrets/mysql_app_password
|
||||
- MYSQL_USER=${ENV_MYSQL_USER}
|
||||
- MYSQL_DATABASE=${ENV_MYSQL_DATABASE}
|
||||
- MYSQL_ALLOW_EMPTY_PASSWORD=no
|
||||
|
||||
healthcheck:
|
||||
test: mysqladmin ping -h 127.0.0.1 -u $$MYSQL_USER --password=$$MYSQL_PASSWORD
|
||||
|
||||
redis:
|
||||
container_name: nextcloud-redis
|
||||
image: redis:${ENV_REDIS_VERSION:-7.4.9-alpine}
|
||||
volumes:
|
||||
- ${ENV_BASE_DIR}/redis/data:/data
|
||||
- ${ENV_BASE_DIR}/redis/config:/usr/local/etc/redis
|
||||
- ${ENV_BASE_DIR}/redis/socket:/var/run/redis
|
||||
networks:
|
||||
- nextcloud_cts
|
||||
ports:
|
||||
- "6379:6379"
|
||||
|
||||
restart: always
|
||||
|
||||
memcached:
|
||||
container_name: nextcloud-memcached
|
||||
image: memcached:${ENV_MEMCACHED_VERSION:-alpine3.23}
|
||||
volumes:
|
||||
- ${ENV_BASE_DIR}/memcached/data:/data
|
||||
- ${ENV_BASE_DIR}/memcached/config:/etc/memcached.conf
|
||||
- ${ENV_BASE_DIR}/memcached/socket:/var/run/memcached
|
||||
networks:
|
||||
- nextcloud_cts
|
||||
ports:
|
||||
- "11211:11211"
|
||||
|
||||
restart: always
|
||||
|
||||
backup:
|
||||
container_name: nextcloud-backup
|
||||
image: databack/mysql-backup:${ENV_BACKUP_VERSION:-1.2.0}
|
||||
networks:
|
||||
- nextcloud_cts
|
||||
|
||||
restart: always
|
||||
secrets:
|
||||
- mysql_root_password
|
||||
|
||||
environment:
|
||||
- DB_SERVER=db
|
||||
- DB_PORT=3306
|
||||
- DB_USER=root
|
||||
- DB_PASS_FILE=/run/secrets/mysql_root_password
|
||||
- DB_DUMP_CRON=0 */6 * * *
|
||||
- DB_DUMP_RETENTION=28
|
||||
- DB_DUMP_TARGET=s3://${ENV_BACKUP_S3_BUCKET}/${ENV_BACKUP_S3_PREFIX}
|
||||
- AWS_ACCESS_KEY_ID=${ENV_BACKUP_S3_ACCESS_KEY}
|
||||
- AWS_SECRET_ACCESS_KEY=${ENV_BACKUP_S3_SECRET_KEY}
|
||||
- AWS_DEFAULT_REGION=${ENV_BACKUP_S3_REGION}
|
||||
- AWS_ENDPOINT_URL=${ENV_BACKUP_S3_ENDPOINT}
|
||||
|
||||
# secret files on server
|
||||
secrets:
|
||||
mysql_root_password:
|
||||
file: /opt/nextcloud/secrets/mariadb_root_password.txt
|
||||
mysql_app_password:
|
||||
file: /opt/nextcloud/secrets/mariadb_app_password.txt
|
||||
|
||||
# default network for this docker stack
|
||||
networks:
|
||||
nextcloud_cts:
|
||||
driver: bridge
|
||||
Reference in New Issue
Block a user