-
-
Save bufanda/5bf19005fb13d892fd26cc22af93d42a to your computer and use it in GitHub Desktop.
an example of an sensible task to install Mattermost app and database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: internal mattermost network | |
docker_network: | |
name: mm.int.network | |
- name: create db container | |
docker_container: | |
name: mattermost-db | |
image: postgres:{{ mattermost_db_version }} | |
restart_policy: unless-stopped | |
volumes: | |
- "{{ mattermost_volume_dir }}/mm/db/var/lib/postgresql/data:/var/lib/postgresql/data" | |
- /etc/localtime:/etc/localtime:ro | |
env: | |
POSTGRES_USER: "{{ mm_db_user }}" | |
POSTGRES_PASSWORD: "{{ mm_db_password }}" | |
POSTGRES_DB: "{{ mm_db_name }}" | |
labels: | |
"{{ mm_db_traefik_labels }}" | |
networks: | |
- name: mm.int.network | |
pull: yes | |
healthcheck: | |
test: ["CMD-SHELL", "pg_isready -U mmuser -d mattermost"] | |
interval: 1m30s | |
timeout: 10s | |
retries: 3 | |
start_period: 30s | |
- name: create app container | |
docker_container: | |
name: mattermost-app | |
image: mattermost/mattermost-team-edition:{{ mattermost_app_version }} | |
restart_policy: unless-stopped | |
volumes: | |
- "{{ mattermost_volume_dir }}/app/mattermost/config:/mattermost/config:rw" | |
- "{{ mattermost_volume_dir }}/app/mattermost/data:/mattermost/data:rw" | |
- "{{ mattermost_volume_dir }}/app/mattermost/logs:/mattermost/logs:rw" | |
- /etc/localtime:/etc/localtime:ro | |
env: | |
# set same as db credentials and dbname | |
MM_USERNAME: "{{ mm_db_user }}" | |
MM_PASSWORD: "{{ mm_db_password }}" | |
MM_DBNAME: "{{ mm_db_name }}" | |
DB_HOST: mattermost-db | |
labels: | |
"{{ mm_traefik_labels }}" | |
networks: | |
- name: mm.int.network | |
- name: traefik.int.network |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment