Advertisement
PhoenyxRLP

Docker Compose Vaultwarden Traefik

Apr 14th, 2023
954
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.67 KB | Source Code | 0 0
  1. version: '3.9'
  2.  
  3. services:
  4.   vault_db:
  5.     image: mariadb
  6.     container_name: vaultwarden_db
  7.     hostname: vaultwarden_db
  8.     restart: always
  9.     environment:
  10.      - MARIADB_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD}
  11.       - MARIADB_DATABASE=${MARIADB_DATABASE}
  12.       - MARIADB_USER=${MARIADB_USER}
  13.       - MARIADB_PASSWORD=${MARIADB_PASSWORD}
  14.     volumes:
  15.      - vault_db_vol:/var/lib/mysql
  16.       - /etc/localtime:/etc/localtime:ro
  17.     networks:
  18.       default:
  19.     ports:
  20.      - 3307:3306
  21.  
  22.   vaultwarden:
  23.     image: vaultwarden/server:latest
  24.     container_name: vaultwarden
  25.     restart: unless-stopped
  26.     env_file:
  27.      - .env
  28.     environment:
  29.      - DATABASE_URL=${DB_URL}
  30.       - LOG_LEVEL=info
  31.       - TZ=Europe/Berlin
  32.       - WEBSOCKET_ENABLED=${WEBSOCKET}
  33.       - ADMIN_TOKEN=${TOKEN}
  34.       - SMTP_FROM_NAME=${SMTP_FROM_NAME}
  35.       - SMTP_HOST=${SMTP_HOST}
  36.       - SMTP_FROM=${SMTP_FROM}
  37.       - SMTP_PORT=${SMTP_PORT}
  38.       - SMTP_SSL=${SMTP_SSL}
  39.       - SMTP_SECURITY=${SMTP_SECURITY}
  40.       - SMTP_USERNAME=${SMTP_USERNAME}
  41.       - SMTP_PASSWORD=${SMTP_PASSWORD}
  42.       - SIGNUPS_VERIFY=true
  43.       - LOG_FILE=/var/log/vaultwarden.log
  44.       - DOMAIN=${DOMAIN}
  45.       - EMAIL=${EMAIL}
  46.       - RUST_BACKTRACE=1
  47.       - SIGNUPS_ALLOWED=false
  48.       - INVITATIONS_ALLOWED=false
  49.     labels:
  50.      - "traefik.enable=true"
  51.       - "traefik.http.routers.vaultwarden.entrypoints=http"
  52.       - "traefik.http.routers.vaultwarden.rule=Host(`vaultwarden.example.me`)"
  53.       - "traefik.http.middlewares.vaultwarden-https-redirect.redirectscheme.scheme=https"
  54.       - "traefik.http.routers.vaultwarden.middlewares=vaultwarden-https-redirect"
  55.       - "traefik.http.routers.vaultwarden-secure.entrypoints=https"
  56.       - "traefik.http.routers.vaultwarden-secure.rule=Host(`vaultwarden.example.me`)"
  57.       - "traefik.http.routers.vaultwarden-secure.tls=true"
  58.       - "traefik.http.routers.vaultwarden-secure.tls.certresolver=http"
  59.       - "traefik.http.routers.vaultwarden-secure.service=vaultwarden"
  60.       - "traefik.http.services.vaultwarden.loadbalancer.server.port=80"
  61.       - "traefik.docker.network=proxy"
  62.       - "traefik.http.routers.vaultwarden-secure.middlewares=secHeaders@file"
  63.     ports:
  64.      - 3112:3012
  65.       - 9380:80
  66.       - 9343:443
  67.     volumes:
  68.       - type: bind
  69.         source: /opt/containers/vaultwarden/data
  70.         target: /data/
  71.     networks:
  72.       proxy:
  73.        ipv4_address: 172.18.0.250
  74.       default:
  75.  
  76. networks:
  77.   proxy:
  78.     name: proxy
  79.     driver: bridge
  80.     attachable: true
  81.     ipam:
  82.       driver: default
  83.       config:
  84.         - subnet: 172.18.0.0/24
  85.           gateway: 172.18.0.1
  86.   default: {}
  87.  
  88. volumes:
  89.  vault_db_vol:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement