ansible/roles/docker/tasks/services/rallly.yml

65 lines
1.9 KiB
YAML
Raw Normal View History

2022-11-26 08:52:41 +00:00
---
2022-11-07 18:05:49 +00:00
- name: Create rallly volume folders
2022-11-26 08:52:41 +00:00
ansible.builtin.file:
name: '{{ services.rallly.volume_folder }}/postgres'
2022-11-07 17:38:08 +00:00
state: directory
2022-11-07 18:05:49 +00:00
- name: Copy Rallly environment file
2022-11-26 08:52:41 +00:00
ansible.builtin.template:
src: files/configs/rallly/env_file.j2
2022-11-26 08:52:41 +00:00
dest: '{{ services.rallly.volume_folder }}/env_file'
2022-11-07 18:05:49 +00:00
2022-11-07 18:08:54 +00:00
- name: Set up Rallly
2022-11-26 08:52:41 +00:00
community.docker.docker_compose:
project_name: rallly
pull: true
2022-11-07 17:38:08 +00:00
definition:
2022-11-26 08:52:41 +00:00
version: '3.8'
2022-11-07 17:38:08 +00:00
services:
2022-11-09 19:41:41 +00:00
rallly_db:
2022-11-26 08:52:41 +00:00
image: postgres:14-alpine
restart: always
shm_size: 256mb
2022-11-07 17:38:08 +00:00
networks:
rallly_internal:
volumes:
2022-11-26 08:52:41 +00:00
- '{{ services.rallly.volume_folder }}/postgres:/var/lib/postgresql/data'
2022-11-07 17:38:08 +00:00
environment:
2022-11-26 08:52:41 +00:00
POSTGRES_PASSWORD: '{{ postgres_passwords.rallly }}'
POSTGRES_DB: rallly_db
2022-11-07 17:38:08 +00:00
healthcheck:
2022-11-26 08:52:41 +00:00
test: [CMD-SHELL, pg_isready -U postgres]
2022-11-07 17:38:08 +00:00
interval: 5s
timeout: 5s
retries: 5
labels:
2022-11-26 08:52:41 +00:00
com.centurylinklabs.watchtower.enable: 'true'
2022-11-07 17:38:08 +00:00
rallly:
2022-11-26 08:52:41 +00:00
image: lukevella/rallly:{{ services.rallly.version }}
restart: always
2022-11-07 17:38:08 +00:00
networks:
rallly_internal:
external_services:
2022-11-07 18:05:49 +00:00
postfix:
2022-11-07 17:38:08 +00:00
depends_on:
rallly_db:
2022-11-26 08:52:41 +00:00
condition: service_healthy
2022-11-07 18:05:49 +00:00
env_file:
2022-11-26 08:52:41 +00:00
- '{{ services.rallly.volume_folder }}/env_file'
2022-11-09 19:41:41 +00:00
environment:
2022-11-26 08:52:41 +00:00
VIRTUAL_HOST: '{{ services.rallly.domain }}'
VIRTUAL_PORT: '3000'
LETSENCRYPT_HOST: '{{ services.rallly.domain }}'
LETSENCRYPT_EMAIL: '{{ letsencrypt_email }}'
2022-11-07 17:38:08 +00:00
labels:
2022-11-26 08:52:41 +00:00
com.centurylinklabs.watchtower.enable: 'true'
2022-11-07 17:38:08 +00:00
networks:
rallly_internal:
internal: true
external_services:
external: true
2022-11-07 18:05:49 +00:00
postfix:
external: true