ansible-nas/tasks/joomla.yml
animeai ce21999f46 Map all ports as variables in all.yml.dist
NOTE: The majority of traefik ports were totally broken and would never have worked. It should be the external port there, not the internal container port!.

Port conflicts were fixed.
2020-01-05 21:47:40 +00:00

45 lines
No EOL
1.2 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: "{{ joomla_port }}"