Debian Codegraph @

examples/awx17/roles/local_docker/templates/docker-compose.yml.j2

raw
1 #jinja2: lstrip_blocks: True
2 version: '2'
3 services:
4
5 web:
6 image: {{ awx_docker_actual_image }}
7 container_name: awx_web
8 depends_on:
9 - redis
10 {% if pg_hostname is not defined %}
11 - postgres
12 {% endif %}
13 {% if (host_port is defined) or (host_port_ssl is defined) %}
14 ports:
15 {% if (host_port_ssl is defined) and (ssl_certificate is defined) %}
16 - "{{ host_port_ssl }}:8053"
17 {% endif %}
18 {% if host_port is defined %}
19 - "{{ host_port }}:8052"
20 {% endif %}
21 {% endif %}
22 hostname: {{ awx_web_hostname }}
23 user: root
24 restart: unless-stopped
25 {% if (awx_web_container_labels is defined) and (',' in awx_web_container_labels) %}
26 {% set awx_web_container_labels_list = awx_web_container_labels.split(',') %}
27 labels:
28 {% for awx_web_container_label in awx_web_container_labels_list %}
29 - {{ awx_web_container_label }}
30 {% endfor %}
31 {% elif awx_web_container_labels is defined %}
32 labels:
33 - {{ awx_web_container_labels }}
34 {% endif %}
35 volumes:
36 - supervisor-socket:/var/run/supervisor
37 - rsyslog-socket:/var/run/awx-rsyslog/
38 - rsyslog-config:/var/lib/awx/rsyslog/
39 - "{{ docker_compose_dir }}/SECRET_KEY:/etc/tower/SECRET_KEY"
40 - "{{ docker_compose_dir }}/environment.sh:/etc/tower/conf.d/environment.sh"
41 - "{{ docker_compose_dir }}/credentials.py:/etc/tower/conf.d/credentials.py"
42 - "{{ docker_compose_dir }}/nginx.conf:/etc/nginx/nginx.conf:ro"
43 - "{{ docker_compose_dir }}/redis_socket:/var/run/redis/:rw"
44 {% if project_data_dir is defined %}
45 - "{{ project_data_dir +':/var/lib/awx/projects:rw' }}"
46 {% endif %}
47 {% if custom_venv_dir is defined %}
48 - "{{ custom_venv_dir +':'+ custom_venv_dir +':rw' }}"
49 {% endif %}
50 {% if ca_trust_dir is defined %}
51 - "{{ ca_trust_dir +':/etc/pki/ca-trust/source/anchors:ro' }}"
52 {% endif %}
53 {% if (ssl_certificate is defined) and (ssl_certificate_key is defined) %}
54 - "{{ ssl_certificate +':/etc/nginx/awxweb.pem:ro' }}"
55 - "{{ ssl_certificate_key +':/etc/nginx/awxweb_key.pem:ro' }}"
56 {% elif (ssl_certificate is defined) and (ssl_certificate_key is not defined) %}
57 - "{{ ssl_certificate +':/etc/nginx/awxweb.pem:ro' }}"
58 {% endif %}
59 {% if (awx_container_search_domains is defined) and (',' in awx_container_search_domains) %}
60 {% set awx_container_search_domains_list = awx_container_search_domains.split(',') %}
61 dns_search:
62 {% for awx_container_search_domain in awx_container_search_domains_list %}
63 - {{ awx_container_search_domain }}
64 {% endfor %}
65 {% elif awx_container_search_domains is defined %}
66 dns_search: "{{ awx_container_search_domains }}"
67 {% endif %}
68 {% if (awx_alternate_dns_servers is defined) and (',' in awx_alternate_dns_servers) %}
69 {% set awx_alternate_dns_servers_list = awx_alternate_dns_servers.split(',') %}
70 dns:
71 {% for awx_alternate_dns_server in awx_alternate_dns_servers_list %}
72 - {{ awx_alternate_dns_server }}
73 {% endfor %}
74 {% elif awx_alternate_dns_servers is defined %}
75 dns: "{{ awx_alternate_dns_servers }}"
76 {% endif %}
77 {% if (docker_compose_extra_hosts is defined) and (':' in docker_compose_extra_hosts) %}
78 {% set docker_compose_extra_hosts_list = docker_compose_extra_hosts.split(',') %}
79 extra_hosts:
80 {% for docker_compose_extra_host in docker_compose_extra_hosts_list %}
81 - "{{ docker_compose_extra_host }}"
82 {% endfor %}
83 {% endif %}
84 environment:
85 http_proxy: {{ http_proxy | default('') }}
86 https_proxy: {{ https_proxy | default('') }}
87 no_proxy: {{ no_proxy | default('') }}
88 {% if docker_logger is defined %}
89 logging:
90 driver: {{ docker_logger }}
91 {% endif %}
92
93 task:
94 image: {{ awx_docker_actual_image }}
95 container_name: awx_task
96 depends_on:
97 - redis
98 - web
99 {% if pg_hostname is not defined %}
100 - postgres
101 {% endif %}
102 command: /usr/bin/launch_awx_task.sh
103 hostname: {{ awx_task_hostname }}
104 user: root
105 restart: unless-stopped
106 volumes:
107 - supervisor-socket:/var/run/supervisor
108 - rsyslog-socket:/var/run/awx-rsyslog/
109 - rsyslog-config:/var/lib/awx/rsyslog/
110 - "{{ docker_compose_dir }}/SECRET_KEY:/etc/tower/SECRET_KEY"
111 - "{{ docker_compose_dir }}/environment.sh:/etc/tower/conf.d/environment.sh"
112 - "{{ docker_compose_dir }}/credentials.py:/etc/tower/conf.d/credentials.py"
113 - "{{ docker_compose_dir }}/redis_socket:/var/run/redis/:rw"
114 {% if project_data_dir is defined %}
115 - "{{ project_data_dir +':/var/lib/awx/projects:rw' }}"
116 {% endif %}
117 {% if custom_venv_dir is defined %}
118 - "{{ custom_venv_dir +':'+ custom_venv_dir +':rw' }}"
119 {% endif %}
120 {% if ca_trust_dir is defined %}
121 - "{{ ca_trust_dir +':/etc/pki/ca-trust/source/anchors:ro' }}"
122 {% endif %}
123 {% if ssl_certificate is defined %}
124 - "{{ ssl_certificate +':/etc/nginx/awxweb.pem:ro' }}"
125 {% endif %}
126 {% if (awx_container_search_domains is defined) and (',' in awx_container_search_domains) %}
127 {% set awx_container_search_domains_list = awx_container_search_domains.split(',') %}
128 dns_search:
129 {% for awx_container_search_domain in awx_container_search_domains_list %}
130 - {{ awx_container_search_domain }}
131 {% endfor %}
132 {% elif awx_container_search_domains is defined %}
133 dns_search: "{{ awx_container_search_domains }}"
134 {% endif %}
135 {% if (awx_alternate_dns_servers is defined) and (',' in awx_alternate_dns_servers) %}
136 {% set awx_alternate_dns_servers_list = awx_alternate_dns_servers.split(',') %}
137 dns:
138 {% for awx_alternate_dns_server in awx_alternate_dns_servers_list %}
139 - {{ awx_alternate_dns_server }}
140 {% endfor %}
141 {% elif awx_alternate_dns_servers is defined %}
142 dns: "{{ awx_alternate_dns_servers }}"
143 {% endif %}
144 {% if (docker_compose_extra_hosts is defined) and (':' in docker_compose_extra_hosts) %}
145 {% set docker_compose_extra_hosts_list = docker_compose_extra_hosts.split(',') %}
146 extra_hosts:
147 {% for docker_compose_extra_host in docker_compose_extra_hosts_list %}
148 - "{{ docker_compose_extra_host }}"
149 {% endfor %}
150 {% endif %}
151 environment:
152 AWX_SKIP_MIGRATIONS: "1"
153 http_proxy: {{ http_proxy | default('') }}
154 https_proxy: {{ https_proxy | default('') }}
155 no_proxy: {{ no_proxy | default('') }}
156 SUPERVISOR_WEB_CONFIG_PATH: '/etc/supervisord.conf'
157
158 redis:
159 image: {{ redis_image }}
160 container_name: awx_redis
161 restart: unless-stopped
162 environment:
163 http_proxy: {{ http_proxy | default('') }}
164 https_proxy: {{ https_proxy | default('') }}
165 no_proxy: {{ no_proxy | default('') }}
166 command: ["/usr/local/etc/redis/redis.conf"]
167 volumes:
168 - "{{ docker_compose_dir }}/redis.conf:/usr/local/etc/redis/redis.conf:ro"
169 - "{{ docker_compose_dir }}/redis_socket:/var/run/redis/:rw"
170 {% if docker_logger is defined %}
171 logging:
172 driver: {{ docker_logger }}
173 {% endif %}
174
175 {% if pg_hostname is not defined %}
176 postgres:
177 image: {{ postgresql_image }}
178 container_name: awx_postgres
179 restart: unless-stopped
180 volumes:
181 - "{{ postgres_data_dir }}/12/data/:/var/lib/postgresql/data:Z"
182 environment:
183 POSTGRES_USER: {{ pg_username }}
184 POSTGRES_PASSWORD: {{ pg_password }}
185 POSTGRES_DB: {{ pg_database }}
186 http_proxy: {{ http_proxy | default('') }}
187 https_proxy: {{ https_proxy | default('') }}
188 no_proxy: {{ no_proxy | default('') }}
189 {% if docker_logger is defined %}
190 logging:
191 driver: {{ docker_logger }}
192 {% endif %}
193 {% endif %}
194
195 {% if docker_compose_subnet is defined %}
196 networks:
197 default:
198 driver: bridge
199 ipam:
200 driver: default
201 config:
202 - subnet: {{ docker_compose_subnet }}
203 {% endif %}
204
205 volumes:
206 supervisor-socket:
207 rsyslog-socket:
208 rsyslog-config: