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.
This commit is contained in:
Davide Oddone 2023-03-21 22:45:14 +01:00
parent 82ee98a7cc
commit df5d0006a3

View File

@ -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: