2018-01-17 12:16:50 +03:00
#jinja2: lstrip_blocks: True
version: '2'
services:
web:
image: {{ awx_web_docker_actual_image }}
2019-03-27 19:01:10 +03:00
container_name: awx_web
2018-01-17 12:16:50 +03:00
depends_on:
- rabbitmq
- memcached
{% if pg_hostname is not defined %}
- postgres
{% endif %}
ports:
2019-04-03 18:50:10 +03:00
{% if ssl_certificate is defined %}
- "{{ host_port_ssl }}:8053"
{% endif %}
2018-01-17 12:16:50 +03:00
- "{{ host_port }}:8052"
2018-08-04 11:49:07 +03:00
hostname: {{ awx_web_hostname }}
2018-01-17 12:16:50 +03:00
user: root
restart: unless-stopped
2018-03-12 16:50:44 +03:00
volumes:
2019-03-26 22:13:20 +03:00
- "{{ docker_compose_dir }}/SECRET_KEY:/etc/tower/SECRET_KEY"
- "{{ docker_compose_dir }}/environment.sh:/etc/tower/conf.d/environment.sh"
- "{{ docker_compose_dir }}/credentials.py:/etc/tower/conf.d/credentials.py"
2018-03-14 13:40:56 +03:00
{% if project_data_dir is defined %}
2018-03-12 16:50:44 +03:00
- "{{ project_data_dir +':/var/lib/awx/projects:rw' }}"
{% endif %}
2018-03-14 13:40:56 +03:00
{% if ca_trust_dir is defined %}
2018-04-02 21:23:23 +03:00
- "{{ ca_trust_dir +':/etc/pki/ca-trust/source/anchors:ro' }}"
2018-03-14 13:40:56 +03:00
{% endif %}
2019-04-03 18:11:33 +03:00
{% if ssl_certificate is defined %}
- "{{ ssl_certificate +':/etc/nginx/awxweb.pem:ro' }}"
{% endif %}
2018-03-19 23:08:52 +03:00
{% if (awx_container_search_domains is defined) and (',' in awx_container_search_domains) %}
2018-03-09 13:04:26 +03:00
{% set awx_container_search_domains_list = awx_container_search_domains.split(',') %}
dns_search:
{% for awx_container_search_domain in awx_container_search_domains_list %}
- {{ awx_container_search_domain }}
{% endfor %}
2018-03-19 23:08:52 +03:00
{% elif awx_container_search_domains is defined %}
2018-01-17 12:16:50 +03:00
dns_search: "{{ awx_container_search_domains }}"
2018-03-19 23:08:52 +03:00
{% endif %}
{% if (awx_alternate_dns_servers is defined) and (',' in awx_alternate_dns_servers) %}
2018-03-09 13:04:26 +03:00
{% set awx_alternate_dns_servers_list = awx_alternate_dns_servers.split(',') %}
dns:
{% for awx_alternate_dns_server in awx_alternate_dns_servers_list %}
- {{ awx_alternate_dns_server }}
{% endfor %}
2018-04-11 18:06:34 +03:00
{% elif awx_alternate_dns_servers is defined %}
dns: "{{ awx_alternate_dns_servers }}"
2018-03-19 23:08:52 +03:00
{% endif %}
2018-01-17 12:16:50 +03:00
environment:
http_proxy: {{ http_proxy | default('') }}
https_proxy: {{ https_proxy | default('') }}
no_proxy: {{ no_proxy | default('') }}
task:
image: {{ awx_task_docker_actual_image }}
2019-03-27 19:01:10 +03:00
container_name: awx_task
2018-01-17 12:16:50 +03:00
depends_on:
- rabbitmq
- memcached
- web
{% if pg_hostname is not defined %}
- postgres
{% endif %}
2018-08-04 11:49:07 +03:00
hostname: {{ awx_task_hostname }}
2018-01-17 12:16:50 +03:00
user: root
restart: unless-stopped
2018-03-12 16:50:44 +03:00
volumes:
2019-03-26 22:13:20 +03:00
- "{{ docker_compose_dir }}/SECRET_KEY:/etc/tower/SECRET_KEY"
- "{{ docker_compose_dir }}/environment.sh:/etc/tower/conf.d/environment.sh"
- "{{ docker_compose_dir }}/credentials.py:/etc/tower/conf.d/credentials.py"
2018-03-14 13:41:10 +03:00
{% if project_data_dir is defined %}
2018-03-12 16:50:44 +03:00
- "{{ project_data_dir +':/var/lib/awx/projects:rw' }}"
{% endif %}
2018-03-14 13:41:10 +03:00
{% if ca_trust_dir is defined %}
2018-04-02 21:23:23 +03:00
- "{{ ca_trust_dir +':/etc/pki/ca-trust/source/anchors:ro' }}"
2018-03-14 13:41:10 +03:00
{% endif %}
2019-04-03 18:11:33 +03:00
{% if ssl_certificate is defined %}
- "{{ ssl_certificate +':/etc/nginx/awxweb.pem:ro' }}"
{% endif %}
2018-03-22 22:07:46 +03:00
{% if (awx_container_search_domains is defined) and (',' in awx_container_search_domains) %}
2018-03-09 13:04:26 +03:00
{% set awx_container_search_domains_list = awx_container_search_domains.split(',') %}
dns_search:
{% for awx_container_search_domain in awx_container_search_domains_list %}
- {{ awx_container_search_domain }}
{% endfor %}
2018-03-19 23:08:52 +03:00
{% elif awx_container_search_domains is defined %}
2018-01-17 12:16:50 +03:00
dns_search: "{{ awx_container_search_domains }}"
2018-03-19 23:08:52 +03:00
{% endif %}
{% if (awx_alternate_dns_servers is defined) and (',' in awx_alternate_dns_servers) %}
2018-03-09 13:04:26 +03:00
{% set awx_alternate_dns_servers_list = awx_alternate_dns_servers.split(',') %}
dns:
{% for awx_alternate_dns_server in awx_alternate_dns_servers_list %}
- {{ awx_alternate_dns_server }}
{% endfor %}
2018-04-11 18:06:34 +03:00
{% elif awx_alternate_dns_servers is defined %}
2018-01-22 00:14:06 +03:00
dns: "{{ awx_alternate_dns_servers }}"
2018-03-19 23:08:52 +03:00
{% endif %}
2018-01-17 12:16:50 +03:00
environment:
http_proxy: {{ http_proxy | default('') }}
https_proxy: {{ https_proxy | default('') }}
no_proxy: {{ no_proxy | default('') }}
rabbitmq:
2018-03-28 06:28:16 +03:00
image: {{ rabbitmq_image }}
2019-03-27 19:01:10 +03:00
container_name: awx_rabbitmq
2018-01-17 12:16:50 +03:00
restart: unless-stopped
environment:
2019-03-27 19:01:10 +03:00
RABBITMQ_DEFAULT_VHOST: "{{ rabbitmq_default_vhost }}"
RABBITMQ_DEFAULT_USER: "{{ rabbitmq_user }}"
2019-06-03 12:45:21 +03:00
RABBITMQ_DEFAULT_PASS: "{{ rabbitmq_password | quote }}"
2019-03-27 19:01:10 +03:00
RABBITMQ_ERLANG_COOKIE: {{ rabbitmq_erlang_cookie }}
2019-05-18 14:55:13 +03:00
http_proxy: {{ http_proxy | default('') }}
https_proxy: {{ https_proxy | default('') }}
no_proxy: {{ no_proxy | default('') }}
2018-01-17 12:16:50 +03:00
memcached:
2019-07-11 18:15:09 +03:00
image: "{{ memcached_image }}:{{ memcached_version }}"
2019-03-27 19:01:10 +03:00
container_name: awx_memcached
2018-01-17 12:16:50 +03:00
restart: unless-stopped
2019-05-18 14:55:13 +03:00
environment:
http_proxy: {{ http_proxy | default('') }}
https_proxy: {{ https_proxy | default('') }}
no_proxy: {{ no_proxy | default('') }}
2018-01-17 12:16:50 +03:00
{% if pg_hostname is not defined %}
postgres:
2019-09-10 03:18:01 +03:00
image: postgres:10
2019-03-27 19:01:10 +03:00
container_name: awx_postgres
2018-01-17 12:16:50 +03:00
restart: unless-stopped
volumes:
2019-09-10 03:18:01 +03:00
- {{ postgres_data_dir }}/10/data/:/var/lib/postgresql/data/pgdata:Z
2018-01-17 12:16:50 +03:00
environment:
POSTGRES_USER: {{ pg_username }}
2019-05-24 23:30:06 +03:00
POSTGRES_PASSWORD: {{ pg_password }}
2018-01-17 12:16:50 +03:00
POSTGRES_DB: {{ pg_database }}
PGDATA: /var/lib/postgresql/data/pgdata
2019-05-18 14:55:13 +03:00
http_proxy: {{ http_proxy | default('') }}
https_proxy: {{ https_proxy | default('') }}
no_proxy: {{ no_proxy | default('') }}
2018-01-17 12:16:50 +03:00
{% endif %}