-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
72 lines (67 loc) · 2.34 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
version: '3.7'
services:
bitwarden:
# Standard Bitwarden is very resource-heavy and cannot run on micro cloud instances
# Vaultwarden is a Rust (mostly) feature-complete implementation of Bitwarden
# https://github.com/dani-garcia/vaultwarden
image: vaultwarden/server:alpine
restart: always
container_name: bitwarden
depends_on:
- tailscale-caddy
volumes:
- ${PWD}/vautlwarden_data:/data
- ${PWD}/ownwarden/utilities/backup.sh:/backup.sh:ro
environment:
- LOG_FILE=/data/bitwarden.log
- WEBSOCKET_ENABLED=true # required for websockets
- SHOW_PASSWORD_HINT=false
- DOMAIN=https://${TAILSCALE_DOMAIN} # DOMAIN is set in .env but doesn't have protocol prefix
- SMTP_FROM_NAME=Bitwarden (${TAILSCALE_DOMAIN})
- IP_HEADER=X-Forwarded-For
- ADMIN_TOKEN # Value-less variables are set in .env
- SIGNUPS_ALLOWED
- SMTP_HOST
- SMTP_FROM
- SMTP_PORT
- SMTP_SECURITY
- SMTP_USERNAME
- SMTP_PASSWORD
- YUBICO_CLIENT_ID
- YUBICO_SECRET_KEY
- YUBICO_SERVER
- ORG_CREATION_USERS
- BACKUP
- BACKUP_DAYS
- BACKUP_DIR
- BACKUP_EMAIL_FROM_NAME
- BACKUP_ENCRYPTION_KEY
- BACKUP_EMAIL_TO
- BACKUP_EMAIL_NOTIFY
- BACKUP_RCLONE_CONF
- BACKUP_RCLONE_DEST
command: >
sh -c 'if [ -n "$BACKUP" ];
then
apk --update --no-cache add sqlite
ln -sf /proc/1/fd/1 /var/log/backup.log &&
sed -i "/ash \\/backup\\.sh /d" /etc/crontabs/root &&
echo "$BACKUP_SCHEDULE ash /backup.sh $BACKUP" >> /etc/crontabs/root &&
crond -d 8;
fi &&
exec /start.sh'
tailscale-caddy:
hostname: tailscale-caddy
image: abhinavrau/caddy_tailscale:latest
environment:
TAILSCALE_AUTH_KEY: ${TAILSCALE_AUTH_KEY:?err}
TAILSCALE_HOSTNAME: ${TAILSCALE_HOSTNAME}
TAILSCALE_STATE_ARG: "/var/lib/tailscale_state/tailscale.state"
TAILSCALE_STATE_DIR: "/var/lib/tailscale_state/"
TS_PORT: "8443"
volumes:
# a volume is used but it could be a local directory.
- ${PWD}/ownwarden/Caddyfile:/etc/caddy/Caddyfile
- ${PWD}/caddy_tailscale/tailscale_state:/var/lib/tailscale_state/
- ${PWD}/caddy_tailscale/data:/data
- ${PWD}/caddy_tailscale/config:/config