1
0
Fork 0

ansible: use 'compose' module, gaining support for check-mode etc.

This commit is contained in:
Julian Foad 2024-10-18 16:28:58 +01:00
parent b86a3a7a5a
commit 8b1e9a0ee5
2 changed files with 10 additions and 4 deletions

View file

@ -6,5 +6,8 @@
template: src="docker-compose.yml.j2" dest="{{ qux_home }}/docker-compose.yml" template: src="docker-compose.yml.j2" dest="{{ qux_home }}/docker-compose.yml"
- name: "docker compose up" - name: "docker compose up"
command: community.docker.docker_compose_v2:
cmd: "docker compose --project-directory={{ qux_home }} up --remove-orphans -d" project_src: "{{ qux_home }}"
#project_name: "{{ qux_home|basename }}"
pull: "{{ 'always' if qux_pull|default(false) else omit }}"
remove_orphans: true

View file

@ -1,12 +1,13 @@
version: '3' ---
services: services:
mongo: mongo:
restart: always restart: always
container_name: quant-ux-mongo container_name: quant-ux-mongo
image: "{{ qux_docker_image_mongo }}" image: "{{ qux_docker_image_mongo }}"
volumes: volumes:
- ./data:/data/db # pth for the data to be stored and kept on your host machine is on the left side of the ":" - ./data:/data/db # pth for the data to be stored and kept on your host machine is on the left side of the ":"
qux-fe: qux-fe:
restart: always restart: always
container_name: quant-ux-frontend container_name: quant-ux-frontend
@ -30,6 +31,7 @@ services:
{% endif %} {% endif %}
depends_on: depends_on:
- qux-be - qux-be
qux-be: qux-be:
restart: always restart: always
container_name: quant-ux-backend container_name: quant-ux-backend
@ -52,6 +54,7 @@ services:
- TZ={{ tz }} - TZ={{ tz }}
depends_on: depends_on:
- mongo - mongo
qux-ws: qux-ws:
restart: always restart: always
container_name: quant-ux-websocket-server container_name: quant-ux-websocket-server