ansible-nas/tasks/joomla.yml

45 lines
No EOL
1.1 KiB
YAML

---
- name: Create Joomla Directories
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ joomla_data_directory }}"
- "{{ joomla_data_directory }}/db"
- name: MySQL Docker Container for Joomla
docker_container:
name: joomla_mysql
image: mysql:5.7
pull: true
volumes:
- "{{ joomla_data_directory }}/db:/var/lib/mysql"
env:
MYSQL_DATABASE: "joomla"
MYSQL_USER: "joomla"
MYSQL_ROOT_PASSWORD: "{{ joomla_database_password }}"
restart_policy: unless-stopped
memory: 1g
- name: Joomla Docker Container
docker_container:
name: joomla
image: joomla
pull: true
volumes:
- "{{ joomla_data_directory }}:/var/www/html:rw"
ports:
- "{{ joomla_port }}:80"
links:
- "joomla_mysql:mysql"
env:
JOOMLA_DB_HOST: "mysql"
JOOMLA_DB_USER: "root"
JOOMLA_DB_PASSWORD: "{{ joomla_database_password }}"
restart_policy: unless-stopped
memory: 1g
labels:
traefik.backend: "joomla"
traefik.frontend.rule: "Host: joomla.{{ ansible_nas_domain }}"
traefik.enable: "{{ joomla_available_externally }}"
traefik.port: "80"