Install a stack from a public image. Mount the configuration file.
This commit is contained in:
parent
1c41052e76
commit
ba6d510c21
|
@ -19,6 +19,7 @@ shinyproxy_http_port: 8080
|
||||||
shinyproxy_log_retention: 10
|
shinyproxy_log_retention: 10
|
||||||
shinyproxy_default_apps: True
|
shinyproxy_default_apps: True
|
||||||
# Shinyproxy as docker service
|
# Shinyproxy as docker service
|
||||||
|
shinyproxy_docker_image: 'adellamisti/shinyproxy:latest'
|
||||||
shinyproxy_as_docker_src_dir: /srv/shinyproxy_service
|
shinyproxy_as_docker_src_dir: /srv/shinyproxy_service
|
||||||
shinyproxy_as_docker_service_name: 'shinyproxy'
|
shinyproxy_as_docker_service_name: 'shinyproxy'
|
||||||
shinyproxy_docker_network: 'shinyproxy'
|
shinyproxy_docker_network: 'shinyproxy'
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
- name: Manage the composition of shinyproxy as a docker swarm service
|
- name: Manage the composition of shinyproxy as a docker (non swarm) service
|
||||||
block:
|
block:
|
||||||
- name: Create the directory where the dockerfile and the configuration file will be copied to
|
- name: Create the directory where the dockerfile and the configuration file will be copied into
|
||||||
file: dest={{ shinyproxy_as_docker_src_dir }} state=directory
|
file: dest={{ shinyproxy_as_docker_src_dir }} state=directory
|
||||||
|
|
||||||
- name: Install the shinyproxy configuration file when using version 2.x
|
- name: Install the shinyproxy configuration file when using version 2.x
|
||||||
|
@ -10,12 +10,6 @@
|
||||||
- name: Install the shinyproxy docker file
|
- name: Install the shinyproxy docker file
|
||||||
template: src=Dockerfile.j2 dest={{ shinyproxy_as_docker_src_dir }}/Dockerfile owner=root group=root mode=0444
|
template: src=Dockerfile.j2 dest={{ shinyproxy_as_docker_src_dir }}/Dockerfile owner=root group=root mode=0444
|
||||||
|
|
||||||
# - name: Create the docker network used by shinyproxy
|
|
||||||
# docker_network:
|
|
||||||
# name: '{{ shinyproxy_docker_network }}'
|
|
||||||
# driver: overlay
|
|
||||||
# state: present
|
|
||||||
|
|
||||||
- name: Install the docker compose file
|
- name: Install the docker compose file
|
||||||
template: src=shinyproxy-docker-compose.yml.j2 dest={{ shinyproxy_as_docker_src_dir }}/docker-compose.yml
|
template: src=shinyproxy-docker-compose.yml.j2 dest={{ shinyproxy_as_docker_src_dir }}/docker-compose.yml
|
||||||
|
|
||||||
|
@ -24,6 +18,37 @@
|
||||||
project_src: '{{ shinyproxy_as_docker_src_dir }}'
|
project_src: '{{ shinyproxy_as_docker_src_dir }}'
|
||||||
build: yes
|
build: yes
|
||||||
|
|
||||||
run_once: True
|
when: shinyproxy_container_backend == 'docker'
|
||||||
when: docker_swarm_manager_main_node is defined and docker_swarm_manager_main_node | bool
|
|
||||||
tags: [ 'shinyproxy', 'shinyproxy_docker', 'docker' ]
|
tags: [ 'shinyproxy', 'shinyproxy_docker', 'docker' ]
|
||||||
|
|
||||||
|
- name: Manage the installation of the shinyproxy configuration
|
||||||
|
block:
|
||||||
|
- name: Create the directory where the dockerfile and the configuration file will be copied into
|
||||||
|
file: dest={{ shinyproxy_as_docker_src_dir }} state=directory
|
||||||
|
|
||||||
|
- name: Install the shinyproxy configuration file
|
||||||
|
template: src=shinyproxy-2-conf.yml.j2 dest={{ shinyproxy_as_docker_src_dir }}/application.yml owner=root group=root mode=0400
|
||||||
|
|
||||||
|
when: shinyproxy_container_backend == 'docker-swarm'
|
||||||
|
tags: [ 'shinyproxy', 'shinyproxy_swarm', 'docker' ]
|
||||||
|
|
||||||
|
- name: Manage the composition of shinyproxy as a docker swarm stack
|
||||||
|
block:
|
||||||
|
- name: Create the directory where the dockerfile and the configuration file will be copied into
|
||||||
|
file: dest={{ shinyproxy_as_docker_src_dir }} state=directory
|
||||||
|
|
||||||
|
- name: Install the docker compose file
|
||||||
|
template: src=shinyproxy-docker-compose.yml.j2 dest={{ shinyproxy_as_docker_src_dir }}/docker-shinyproxy-stack.yml
|
||||||
|
|
||||||
|
- name: Start the shinyproxy stack
|
||||||
|
docker_stack:
|
||||||
|
name: shinyproxy
|
||||||
|
state: present
|
||||||
|
compose:
|
||||||
|
- '{{ haproxy_docker_compose_dir }}/docker-shinyproxy-stack.yml'
|
||||||
|
|
||||||
|
run_once: True
|
||||||
|
when:
|
||||||
|
- docker_swarm_manager_main_node is defined and docker_swarm_manager_main_node | bool
|
||||||
|
- shinyproxy_container_backend == 'docker-swarm'
|
||||||
|
tags: [ 'shinyproxy', 'shinyproxy_swarm', 'docker' ]
|
||||||
|
|
|
@ -2,15 +2,19 @@ version: '3.6'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
shinyproxy:
|
shinyproxy:
|
||||||
|
{% if shinyproxy_container_backend == 'docker' %}
|
||||||
build: .
|
build: .
|
||||||
|
ports:
|
||||||
|
- '{{ shinyproxy_http_port }}':'{{ shinyproxy_http_port }}'
|
||||||
|
{% else %}
|
||||||
|
image: {{ shinyproxy_docker_image }}
|
||||||
|
{% endif %}
|
||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
#ports:
|
- {{ shinyproxy_as_docker_src_dir }}/application.yml:/opt/shinyproxy/application.yml:ro
|
||||||
# - '{{ shinyproxy_http_port }}':'{{ shinyproxy_http_port }}'
|
|
||||||
expose:
|
|
||||||
- "{{ shinyproxy_http_port }}"
|
|
||||||
networks:
|
networks:
|
||||||
- '{{ shinyproxy_docker_network }}'
|
- shinyproxy_{{ shinyproxy_docker_network }}
|
||||||
|
{% if shinyproxy_container_backend == 'docker-swarm' %}
|
||||||
deploy:
|
deploy:
|
||||||
mode: replicated
|
mode: replicated
|
||||||
replicas: {{ shinyproxy_docker_swarm_replicas }}
|
replicas: {{ shinyproxy_docker_swarm_replicas }}
|
||||||
|
@ -22,6 +26,7 @@ services:
|
||||||
delay: 5s
|
delay: 5s
|
||||||
max_attempts: 3
|
max_attempts: 3
|
||||||
window: 120s
|
window: 120s
|
||||||
|
{% endif %}
|
||||||
{% if docker_log_to_journal %}
|
{% if docker_log_to_journal %}
|
||||||
logging:
|
logging:
|
||||||
driver: 'journald'
|
driver: 'journald'
|
||||||
|
|
Loading…
Reference in New Issue