This playbook deploys Commento with Docker Compose on Debian 10+, Ubuntu LTS, and RHEL 9+ systems.
- name: Deploy Commento
hosts: commento
become: true
vars:
commento_root: /opt/commento
commento_port: 8082
tasks:
- name: Install Docker on Debian/Ubuntu
apt:
update_cache: true
name:
- docker.io
- docker-compose-plugin
state: present
when: ansible_os_family == "Debian"
- name: Install Docker on RHEL family
dnf:
name:
- docker
- docker-compose-plugin
state: present
when: ansible_os_family == "RedHat"
- name: Enable and start Docker
service:
name: docker
state: started
enabled: true
- name: Create Commento directory
file:
path: "{{ commento_root }}"
state: directory
mode: "0755"
- name: Write Commento docker-compose file
copy:
dest: "{{ commento_root }}/docker-compose.yml"
mode: "0644"
content: |
services:
commento:
image: registry.gitlab.com/commento/commento:latest
restart: unless-stopped
ports:
- "{{ commento_port }}:8080"
environment:
COMMENTO_ORIGIN: "http://localhost:{{ commento_port }}"
volumes:
- ./data:/data
- name: Start Commento stack
command: docker compose up -d
args:
chdir: "{{ commento_root }}"
COMMENTO_ORIGIN for your public hostname and add TLS via reverse proxy.