From df5d0006a3f8aca2f6ea4040807c2b330d899fa0 Mon Sep 17 00:00:00 2001 From: Davide Oddone Date: Tue, 21 Mar 2023 22:45:14 +0100 Subject: [PATCH] Refactor of vaultwarden/docker-compose.yml Currently trying to generalize a bit more the compose files. No need to keep the NFS mounts explicitly stated, as most of the times just a small Docker native volume is needed for persistence. --- vaultwarden/docker-compose.yml | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/vaultwarden/docker-compose.yml b/vaultwarden/docker-compose.yml index 19893d8..7dcce56 100644 --- a/vaultwarden/docker-compose.yml +++ b/vaultwarden/docker-compose.yml @@ -1,10 +1,14 @@ x-logging: &default-logging - driver: local + driver: syslog options: - max-size: "1m" - max-file: "50" + # This requires two files in /etc/rsyslog.d + # https://www.loggly.com/use-cases/docker-syslog-logging-and-troubleshooting/ + tag: "container_name/{{.Name}}" + labels: "${hostname}" + syslog-facility: # cron, local7, etc. +# Can be removed if not needed x-opt-values: &volume-opt driver_opts: &options @@ -25,6 +29,7 @@ services: DOMAIN: ${VDOMAIN} # Used by vaultwarden to set certain links WEBSOCKET_ENABLED: "true" SIGNUPS_ALLOWED: "false" # Change to true if it's the first time running + # Optional environment, but useful if you want some functions SMTP_HOST: "${protonmail-container-name}" SMTP_FROM: ${SFROM} SMTP_FROM_NAME: ${SFROMNAME} @@ -39,12 +44,29 @@ services: - vaultwarden - protonmail + vaultwarden-backup: + image: bruceforce/vaultwarden-backup + container_name: vaultwarden-backup + restart: always + environment: + TIMESTAMP: "true" + UID: ${UID} + GID: ${GID} + BACKUP_DIR: ${BACKUP_DIR} + DELETE_AFTER: "30" + CRON_TIME: "0 2 * * *" + volumes: + - vw-data:/data + - backup:/backup + volumes: vw-data: + # This stores the backup on a (possibly) remote server + backup: <<: *volume-opt driver_opts: <<: *options - device: ":/mnt/path/vaultwarden/vw-data" + device: ":/mnt/path/vaultwarden/backup" networks: reverse-proxy: