feat: add bitwarden instance (#16)

This commit is contained in:
Marc 2022-12-21 14:21:10 -05:00 committed by GitHub
parent 95e2d1e2bb
commit 27f7c7a716
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 44 additions and 0 deletions

1
services/bitwarden/.env Normal file
View file

@ -0,0 +1 @@
CONFIG_ROOT=${APP_STORAGE_ROOT:-.}/bitwarden

View file

@ -0,0 +1,29 @@
version: '3.7'
services:
bitwarden:
image: bitwarden/self-host:beta
env_file:
- ${CONFIG_ROOT}/web.env
depends_on:
- db
restart: always
ports:
- 7000:8080
- 7001:8443
volumes:
- ${CONFIG_ROOT}/config:/etc/bitwarden
- ${CONFIG_ROOT}/logs:/var/log/bitwarden
db:
image: mariadb:10
env_file:
- ${CONFIG_ROOT}/db.env
restart: always
volumes:
- ${CONFIG_ROOT}/db:/var/lib/mysql
ports:
- 3306:3306
networks:
default:
name: web
external: true

View file

@ -19,6 +19,13 @@
service = "monolith"
[http.routers.monolith.tls]
certResolver = "lets-encrypt"
[http.routers.bitwarden]
rule = "Host(`spadinaistan.karnov.club`) && (PathPrefix(`/bitwarden/`) || HeadersRegexp(`Bitwarden-Client-Name`, `.*`))"
service = "bitwarden"
middlewares = ["bitwarden-stripprefix", "bitwarden-headers"]
[http.routers.bitwarden.tls]
certResolver = "lets-encrypt"
[http.middlewares]
[http.middlewares.monolith-auth.forwardauth]
@ -30,6 +37,9 @@
[http.middlewares.deluge-stripprefix.stripprefix]
prefixes = ["/deluge"]
[http.middlewares.bitwarden-stripprefix.stripprefix]
prefixes = ["/bitwarden"]
[http.services]
[http.services.deluge.loadBalancer]
[[http.services.deluge.loadBalancer.servers]]
@ -38,3 +48,7 @@
[http.services.monolith.loadBalancer]
[[http.services.monolith.loadBalancer.servers]]
url = "http://monolith:8000/"
[http.services.bitwarden.loadBalancer]
[[http.services.bitwarden.loadBalancer.servers]]
url = "http://bitwarden:8080/"