Die persönlichen Angaben habe ich hier durch xxx ersetzt.
version: "3.9"
services:
db:
image: postgres
container_name: Vaultwarden-DB
hostname: vaultwarden-db
mem_limit: 512m
cpu_shares: 768
security_opt:
- no-new-privileges:true
user: 1026:100
healthcheck:
test: ["CMD", "pg_isready", "-q", "-d", "vaultwarden", "-U", "vaultwardenuser"]
timeout: 45s
interval: 10s
retries: 10
volumes:
- /volume1/docker/vaultwarden/db:/var/lib/postgresql/data:rw
environment:
POSTGRES_DB: vaultwarden
POSTGRES_USER: vaultwardenuser
POSTGRES_PASSWORD: vaultwardenpass
restart: on-failure:5
vaultwarden:
image: vaultwarden/server:latest
container_name: Vaultwarden
hostname: vaultwarden
mem_limit: 256m
mem_reservation: 96m
cpu_shares: 1024
security_opt:
- no-new-privileges:true
user: 1026:100
ports:
- 4080:4020
volumes:
- /volume1/docker/vaultwarden/data:/data:rw
environment:
ROCKET_PORT: 4020
DATABASE_URL: postgresql://vaultwardenuser:vaultwardenpass@vaultwarden-db:5432/vaultwarden
ADMIN_TOKEN: xxx
DISABLE_ADMIN_TOKEN: false
DOMAIN: xxx
SMTP_HOST: xxx
SMTP_FROM: xxx
SMTP_PORT: 587
SMTP_SECURITY: starttls
SMTP_USERNAME: xxx
SMTP_PASSWORD: xxx
restart: on-failure:5
depends_on:
db:
condition: service_started