From 15e7ecd6f1184baf1e4ba14406d6415cfa2bd62d Mon Sep 17 00:00:00 2001 From: David Rotermund Date: Sat, 29 Jun 2024 02:30:19 +0200 Subject: [PATCH] Create compose.yml --- compose.yml | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 compose.yml diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..696fb7c --- /dev/null +++ b/compose.yml @@ -0,0 +1,77 @@ +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 + + networks: + - VaultwardenNet + + vaultwarden: + image: vaultwarden/server:latest + container_name: vaultwarden + restart: always + environment: + DOMAIN: ${DOMAIN} + DATABASE_URL: mysql://vaultwardenuser:${MARIADB_PASSWORD}@mariadb: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 + networks: + - VaultwardenNet + depends_on: + mariadb: + condition: service_healthy + + 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" + networks: + - VaultwardenNet + depends_on: + mariadb: + condition: service_healthy + + +volumes: + vaultwarden_vol: + mariadb_vol: + mariadb_socket: + +networks: + VaultwardenNet: + driver: bridge