ansible-role-docker_vaultwa.../templates/docker-compose.yml
2023-07-29 21:42:14 +02:00

54 lines
2 KiB
YAML

# {{ ansible_managed }}
version: '3.5'
services:
vaultwarden:
image: vaultwarden/server:{{ docker_vaultwarden_version }}
restart: always
environment:
DOMAIN: "https://{{ docker_vaultwarden_fqdn }}"
DATABASE_URL: "postgresql://{{ docker_vaultwarden_db_user }}:{{ docker_vaultwarden_db_password }}@db:5432/{{ docker_vaultwarden_db_name }}"
SIGNUPS_ALLOWED: "{{ docker_vaultwarden_allow_signups }}"
INVITATIONS_ALLOWED: "{{ docker_vaultwarden_allow_invitations }}"
SMTP_HOST: "{{ docker_vaultwarden_smtp_host }}"
SMTP_FROM: "{{ docker_vaultwarden_smtp_from }}"
SMTP_PORT: "{{ docker_vaultwarden_smtp_port }}"
SMTP_SECURITY: "{{ docker_vaultwarden_smtp_security }}"
SMTP_USERNAME: "{{ docker_vaultwarden_smtp_username }}"
SMTP_PASSWORD: "{{ docker_vaultwarden_smtp_password }}"
ADMIN_TOKEN: "{{ docker_vaultwarden_admin_token }}"
volumes:
- {{ docker_vaultwarden_data_dir }}/{{ docker_vaultwarden_service_id }}/vw-data:/data
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.{{ docker_vaultwarden_service_id }}.entrypoints=web"
- "traefik.http.routers.{{ docker_vaultwarden_service_id }}.rule=Host(`{{ docker_vaultwarden_fqdn }}`)"
- "traefik.http.services.{{ docker_vaultwarden_service_id }}.loadbalancer.server.port=80"
depends_on:
db:
condition: service_healthy
networks:
- traefik
- vaultwarden
db:
restart: always
image: postgres:14
shm_size: 256mb
networks:
- vaultwarden
healthcheck:
test: ['CMD', 'pg_isready', '-U', 'postgres']
volumes:
- {{ docker_vaultwarden_data_dir }}/{{ docker_vaultwarden_service_id }}/db_data:/var/lib/postgresql/data
environment:
POSTGRES_DB: "{{ docker_vaultwarden_db_name }}"
POSTGRES_USER: "{{ docker_vaultwarden_db_user }}"
POSTGRES_PASSWORD: "{{ docker_vaultwarden_db_password }}"
networks:
traefik:
external: true
vaultwarden:
internal: true