services: mariadb: image: "mariadb" container_name: "mariadb" hostname: "mariadb" restart: always volumes: - "mariadb_vol:/var/lib/mysql" - "mariadb_socket:/run/mysqld" - "/etc/localtime:/etc/localtime:ro" environment: MARIADB_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD} MARIADB_PASSWORD: ${MARIADB_PASSWORD} MARIADB_DATABASE: "vaultwarden" MARIADB_USER: "vaultwardenuser" MYSQL_UNIX_PORT: "/run/mysqld/mysqld.sock" MYSQL_ROOT_HOST: "%" healthcheck: test: ["CMD", "/bin/sh", "-c", "mariadb-admin ping -h localhost -u root -p$$MARIADB_ROOT_PASSWORD"] interval: 10s timeout: 5s retries: 5 start_period: 10s ports: - 3306:3306 network_mode: bridge vaultwarden: image: vaultwarden/server:latest container_name: vaultwarden restart: always environment: DOMAIN: ${DOMAIN} DATABASE_URL: mysql://vaultwardenuser:${MARIADB_PASSWORD}@localhost:3306/vaultwarden ADMIN_TOKEN: ${VAULTWARDEN_ADMIN_TOKEN} SIGNUPS_DOMAINS_WHITELIST: uni-bremen.de SIGNUPS_ALLOWED: false volumes: - "vaultwarden_vol:/data" - "mariadb_socket:/run/mysqld" ports: - 11001:80 depends_on: mariadb: condition: service_healthy network_mode: bridge nginx: image: nginx:stable-alpine container_name: nginx restart: always volumes: - "/root/nginx/key.pem:/certs/nginx_key.pem:ro" - "/root/nginx/ca.pem:/certs/nginx_certificate.pem:ro" - "/root/nginx/nginx.conf:/etc/nginx/nginx.conf:ro" ports: - "0.0.0.0:443:443" - "0.0.0.0:80:80" environment: NGINX_WORKER_PROCESSES: "4" NGINX_WORKER_CONNECTIONS: "768" depends_on: mariadb: condition: service_healthy network_mode: bridge volumes: vaultwarden_vol: mariadb_vol: mariadb_socket: