datacoop.ansible/roles/docker/tasks/services/membersystem.yml
Sam A. 5bcba6fa59 QoL changes for *Vim users (#144)
Co-authored-by: Sam Al-Sapti <sam@sapti.me>
Reviewed-on: data.coop/ansible#144
2022-12-29 21:13:31 +00:00

55 lines
1.9 KiB
YAML

# vim: ft=yaml.ansible
---
- name: run membersystem containers
docker_compose:
project_name: "member.data.coop"
pull: yes
definition:
version: "3"
services:
backend:
image: docker.data.coop/membersystem:latest
restart: always
user: $UID:$GID
tty: true
depends_on:
- postgres
networks:
- membersystem
- external_services
- postfix
environment:
SECRET_KEY: "{{ membersystem_secrets.secret_key }}"
DATABASE_URL: postgres://postgres:{{ postgres_passwords.membersystem }}@postgres:5432/postgres
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
EMAIL_BACKEND: "django.core.mail.backends.smtp.EmailBackend"
EMAIL_URL: "smtp://noop@{{ smtp_host }}:{{ smtp_port }}"
VIRTUAL_HOST: "{{ services.membersystem.domain }}"
VIRTUAL_PORT: "8000"
LETSENCRYPT_HOST: "{{ services.membersystem.domain }}"
LETSENCRYPT_EMAIL: "{{ letsencrypt_email }}"
ALLOWED_HOSTS: "{{ services.membersystem.domain }}"
CSRF_TRUSTED_ORIGINS: "https://{{ services.membersystem.domain }}"
DJANGO_ADMINS: "{{ services.membersystem.django_admins }}"
DEFAULT_FROM_EMAIL: "noreply@{{ services.membersystem.domain }}"
labels:
com.centurylinklabs.watchtower.enable: "true"
postgres:
image: postgres:13-alpine
restart: always
volumes:
- "{{ volume_root_folder }}/membersystem/postgres/data:/var/lib/postgresql/data"
networks:
- membersystem
environment:
POSTGRES_PASSWORD: "{{ postgres_passwords.membersystem }}"
networks:
membersystem:
external_services:
external: true
postfix:
external: true