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: x-logging:
&default-logging &default-logging
driver: local driver: syslog
options: options:
max-size: "1m" # This requires two files in /etc/rsyslog.d
max-file: "50" # 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: x-opt-values:
&volume-opt &volume-opt
driver_opts: &options driver_opts: &options
@ -25,6 +29,7 @@ services:
DOMAIN: ${VDOMAIN} # Used by vaultwarden to set certain links DOMAIN: ${VDOMAIN} # Used by vaultwarden to set certain links
WEBSOCKET_ENABLED: "true" WEBSOCKET_ENABLED: "true"
SIGNUPS_ALLOWED: "false" # Change to true if it's the first time running 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_HOST: "${protonmail-container-name}"
SMTP_FROM: ${SFROM} SMTP_FROM: ${SFROM}
SMTP_FROM_NAME: ${SFROMNAME} SMTP_FROM_NAME: ${SFROMNAME}
@ -39,12 +44,29 @@ services:
- vaultwarden - vaultwarden
- protonmail - 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: volumes:
vw-data: vw-data:
# This stores the backup on a (possibly) remote server
backup:
<<: *volume-opt <<: *volume-opt
driver_opts: driver_opts:
<<: *options <<: *options
device: ":/mnt/path/vaultwarden/vw-data" device: ":/mnt/path/vaultwarden/backup"
networks: networks:
reverse-proxy: reverse-proxy: