---
- name: Ensure Docker Compose is installed
  ansible.builtin.shell: |
    curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
    chmod +x /usr/local/bin/docker-compose
  args:
    executable: /bin/bash
  become: yes


- name: Copy Docker Compose file
  ansible.builtin.copy:
    src: roles/docker-compose/files/docker-compose.yml
    dest: /opt/docker-compose.yml
  become: yes

  
- name: Run Docker Compose
  ansible.builtin.command:
    cmd: docker-compose up -d
    chdir: /opt
