[root@demo bitwardenrs]# cat > docker-compose.yml << \EOF
version: "3"
services:
bitwardenrs:
image: vaultwarden/server:latest
container_name: bitwardenrs
restart: unless-stopped
environment:
- SIGNUPS_ALLOWED=false # 开启注册,自己注册后改成false,再重启Docker服务。
- WEBSOCKET_ENABLED=true # 开启WebSocket
- WEB_VAULT_ENABLED=true # web客户端
- DOMAIN=https://passwd.rockylinux.cn:4443 # 设置域名,需要替换成自己申请的域名
volumes:
- /SSD/Demo/bitwardenrs/data/:/data/
expose:
- 80
- 3012
networks:
- traefik_net
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik_net"
- "traefik.http.routers.bitwardenrs.rule=Host(passwd.rockylinux.cn)"
- "traefik.http.routers.bitwardenrs.entryPoints=websecure"
- "traefik.http.routers.bitwardenrs.tls.certresolver=myresolver"
- "traefik.http.routers.bitwardenrs.service=bitwardenrs"
- "traefik.http.services.bitwardenrs.loadbalancer.server.port=80"
- "traefik.http.services.bitwardenrs.loadbalancer.server.scheme=http"
# 如果您无法理解以下相关配置,直接原样复制即可。
- "traefik.http.routers.bitwardenrs-http.rule=Host(passwd.rockylinux.cn)"
- "traefik.http.routers.bitwardenrs-http.entryPoints=web"
- "traefik.http.routers.bitwardenrs-http.service=bitwardenrs"
- "traefik.http.routers.bitwarden-websocket.rule=Host(passwd.rockylinux.cn) && Path(/notifications/hub)"
- "traefik.http.routers.bitwarden-websocket.entrypoints=websecure"
- "traefik.http.routers.bitwarden-websocket.tls.certresolver=myresolver"
- "traefik.http.routers.bitwarden-websocket.service=bitwarden-websocket"
- "traefik.http.services.bitwarden-websocket.loadbalancer.server.port=3012"
- "traefik.http.routers.bitwarden-websocket-http.rule=Host(passwd.rockylinux.cn) && Path(/notifications/hub)"
- "traefik.http.routers.bitwarden-websocket-http.entrypoints=web"
- "traefik.http.routers.bitwarden-websocket-http.service=bitwarden-websocket"
networks:
traefik_net:
external: true
EOF
# 启动服务
[root@demo memos]# docker-compose up -d
0 评论