Add SSL suport for docker install

Signed-off-by: walkafwalka <41709139+walkafwalka@users.noreply.github.com>
This commit is contained in:
walkafwalka
2018-08-04 01:50:16 -07:00
committed by Markus Opahle
parent bb276a8fcb
commit 3a7bf6a8ac
5 changed files with 17 additions and 4 deletions

View File

@@ -439,7 +439,11 @@ Before starting the build process, review the [inventory](./installer/inventory)
*host_port* *host_port*
> Provide a port number that can be mapped from the Docker daemon host to the web server running inside the AWX container. Defaults to *80*. > Provide a port number that can be mapped from the Docker daemon host to the web server running inside the AWX container. Defaults to *443*.
*ssl_certificate*
> Optionally, provide the path to a file that contains a certificate and its private key.
*use_docker_compose* *use_docker_compose*
@@ -527,7 +531,7 @@ After the playbook run completes, Docker will report up to 5 running containers.
```bash ```bash
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e240ed8209cd awx_task:1.0.0.8 "/tini -- /bin/sh ..." 2 minutes ago Up About a minute 8052/tcp awx_task e240ed8209cd awx_task:1.0.0.8 "/tini -- /bin/sh ..." 2 minutes ago Up About a minute 8052/tcp awx_task
1cfd02601690 awx_web:1.0.0.8 "/tini -- /bin/sh ..." 2 minutes ago Up About a minute 0.0.0.0:80->8052/tcp awx_web 1cfd02601690 awx_web:1.0.0.8 "/tini -- /bin/sh ..." 2 minutes ago Up About a minute 0.0.0.0:443->8052/tcp awx_web
55a552142bcd memcached:alpine "docker-entrypoint..." 2 minutes ago Up 2 minutes 11211/tcp memcached 55a552142bcd memcached:alpine "docker-entrypoint..." 2 minutes ago Up 2 minutes 11211/tcp memcached
84011c072aad rabbitmq:3 "docker-entrypoint..." 2 minutes ago Up 2 minutes 4369/tcp, 5671-5672/tcp, 25672/tcp rabbitmq 84011c072aad rabbitmq:3 "docker-entrypoint..." 2 minutes ago Up 2 minutes 4369/tcp, 5671-5672/tcp, 25672/tcp rabbitmq
97e196120ab3 postgres:9.6 "docker-entrypoint..." 2 minutes ago Up 2 minutes 5432/tcp postgres 97e196120ab3 postgres:9.6 "docker-entrypoint..." 2 minutes ago Up 2 minutes 5432/tcp postgres

View File

@@ -52,7 +52,8 @@ dockerhub_base=ansible
awx_task_hostname=awx awx_task_hostname=awx
awx_web_hostname=awxweb awx_web_hostname=awxweb
postgres_data_dir=/tmp/pgdocker postgres_data_dir=/tmp/pgdocker
host_port=80 host_port=443
#ssl_certificate=
# Docker Compose Install # Docker Compose Install
# use_docker_compose=false # use_docker_compose=false

View File

@@ -53,6 +53,10 @@ RUN rm -rf /tmp/*
RUN echo "{{ awx_version }}" > /var/lib/awx/.tower_version RUN echo "{{ awx_version }}" > /var/lib/awx/.tower_version
ADD nginx.conf /etc/nginx/nginx.conf ADD nginx.conf /etc/nginx/nginx.conf
RUN openssl req -newkey rsa:4906 -nodes -keyout key.pem -x509 -days 365 -out certificate.pem -subj "/CN=localhost/" && \
cat certificate.pem key.pem > /etc/nginx/awxweb.pem && \
chmod 0600 /etc/nginx/awxweb.pem && \
rm certificate.pem key.pem
ADD supervisor.conf /supervisor.conf ADD supervisor.conf /supervisor.conf
ADD supervisor_task.conf /supervisor_task.conf ADD supervisor_task.conf /supervisor_task.conf
ADD launch_awx.sh /usr/bin/launch_awx.sh ADD launch_awx.sh /usr/bin/launch_awx.sh

View File

@@ -36,7 +36,10 @@ http {
} }
server { server {
listen 8052 default_server; listen 8052 ssl default_server;
ssl_certificate /etc/nginx/awxweb.pem;
ssl_certificate_key /etc/nginx/awxweb.pem;
# If you have a domain name, this is where to add it # If you have a domain name, this is where to add it
server_name _; server_name _;

View File

@@ -86,6 +86,7 @@
{{ {{
([project_data_dir + ':/var/lib/awx/projects:z'] if project_data_dir is defined else []) ([project_data_dir + ':/var/lib/awx/projects:z'] if project_data_dir is defined else [])
+ ([ca_trust_dir + ':/etc/pki/ca-trust/source/anchors:ro'] if ca_trust_dir is defined else []) + ([ca_trust_dir + ':/etc/pki/ca-trust/source/anchors:ro'] if ca_trust_dir is defined else [])
+ ([ssl_certificate + ':/etc/nginx/awxweb.pem:ro'] if ssl_certificate is defined else [])
}} }}
user: root user: root
ports: ports: