quant-ux: new role
This commit is contained in:
commit
8149974354
3 changed files with 99 additions and 0 deletions
18
defaults/main.yml
Normal file
18
defaults/main.yml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
---
|
||||||
|
qux_domain: ~
|
||||||
|
|
||||||
|
# addressing: fe=FrontEnd service, ws=WebSocket service
|
||||||
|
# port number to bind, or null (~) not to bind
|
||||||
|
qux_fe_host_bind_port: ~ # e.g. 8082
|
||||||
|
qux_ws_host_bind_port: ~ # e.g. 8086
|
||||||
|
|
||||||
|
qux_jwt_password: ~
|
||||||
|
|
||||||
|
qux_home: /home/qux
|
||||||
|
|
||||||
|
qux_docker_image_mongo: mongo:7.0.5
|
||||||
|
#qux_docker_image_fe: bmcgonag/qux-fe:2.2.0
|
||||||
|
#qux_docker_image_be: bmcgonag/qux-be:2.2.0
|
||||||
|
qux_docker_image_fe: klausenschaefersinho/quant-ux
|
||||||
|
qux_docker_image_be: klausenschaefersinho/quant-ux-backend
|
||||||
|
qux_docker_image_ws: klausenschaefersinho/quant-ux-websocket
|
10
tasks/main.yml
Normal file
10
tasks/main.yml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
---
|
||||||
|
- name: "home dir"
|
||||||
|
file: state=directory path="{{ qux_home }}"
|
||||||
|
|
||||||
|
- name: "config file"
|
||||||
|
template: src="docker-compose.yml.j2" dest="{{ qux_home }}/docker-compose.yml"
|
||||||
|
|
||||||
|
- name: "docker compose up"
|
||||||
|
command:
|
||||||
|
cmd: "docker compose --project-directory={{ qux_home }} up --remove-orphans -d"
|
71
templates/docker-compose.yml.j2
Normal file
71
templates/docker-compose.yml.j2
Normal file
|
@ -0,0 +1,71 @@
|
||||||
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
mongo:
|
||||||
|
restart: always
|
||||||
|
container_name: quant-ux-mongo
|
||||||
|
image: "{{ qux_docker_image_mongo }}"
|
||||||
|
volumes:
|
||||||
|
- ./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:
|
||||||
|
restart: always
|
||||||
|
container_name: quant-ux-frontend
|
||||||
|
image: "{{ qux_docker_image_fe }}"
|
||||||
|
environment:
|
||||||
|
- QUX_PROXY_URL=http://quant-ux-backend:8080 # this is the path the front end uses to talk tot he backend
|
||||||
|
- QUX_WS_URL=wss://ws.{{ qux_domain }} # change to where the websocket server is deployed for external access
|
||||||
|
links:
|
||||||
|
- mongo
|
||||||
|
- qux-be
|
||||||
|
ports:
|
||||||
|
- "{{ qux_fe_host_bind_port ~ ':8082' if qux_fe_host_bind_port else '8082' }}"
|
||||||
|
depends_on:
|
||||||
|
- qux-be
|
||||||
|
labels:
|
||||||
|
traefik.enable: "true"
|
||||||
|
traefik.http.routers.qux-fe.entryPoints: "web_https"
|
||||||
|
traefik.http.routers.qux-fe.rule: "Host(`{{ qux_domain }}`)"
|
||||||
|
qux-be:
|
||||||
|
restart: always
|
||||||
|
container_name: quant-ux-backend
|
||||||
|
image: "{{ qux_docker_image_be }}"
|
||||||
|
volumes:
|
||||||
|
- ./quant-ux-data:/app-data
|
||||||
|
environment:
|
||||||
|
- QUX_HTTP_HOST=http://quant-ux-frontend:8082 # this is the path the backend uses to talk to the front end
|
||||||
|
- QUX_HTTP_PORT=8080 # This is the port the backend will use
|
||||||
|
- QUX_MONGO_DB_NAME=quantux # the database / collection name in mongodb
|
||||||
|
- QUX_MONGO_TABLE_PREFIX=quantux # table / document prefix in mongodb
|
||||||
|
- QUX_MONGO_CONNECTION_STRING=mongodb://quant-ux-mongo:27017 # this assumes your mongodb container will be called "quant-ux-mongo" in the docker-compose file
|
||||||
|
- QUX_MAIL_USER=mail_admin@example.com # this should be your smtp email user
|
||||||
|
- QUX_MAIL_PASSWORD=sTr0ngPa55w0Rd # this should be your smtp email password
|
||||||
|
- QUX_MAIL_HOST=mail.example.com # this should be your smtp host address
|
||||||
|
- QUX_JWT_PASSWORD="{{ qux_jwt_password }}"
|
||||||
|
- QUX_IMAGE_FOLDER_USER=/app-data/qux-images # this folder should mapped in the volume
|
||||||
|
- QUX_IMAGE_FOLDER_APPS=/app-data/qux-image-apps # this folder should mapped in the volume
|
||||||
|
- QUX_DEBUG=true # valid values are true or false
|
||||||
|
- TZ={{ tz }}
|
||||||
|
depends_on:
|
||||||
|
- mongo
|
||||||
|
qux-ws:
|
||||||
|
restart: always
|
||||||
|
container_name: quant-ux-websocket-server
|
||||||
|
image: klausenschaefersinho/quant-ux-websocket
|
||||||
|
environment:
|
||||||
|
- QUX_SERVER=http://quant-ux-backend:8080/
|
||||||
|
- QUX_SERVER_PORT=8086
|
||||||
|
ports:
|
||||||
|
- "{{ qux_ws_host_bind_port ~ ':8086' if qux_ws_host_bind_port else '8086' }}"
|
||||||
|
links:
|
||||||
|
- qux-be
|
||||||
|
depends_on:
|
||||||
|
- qux-be
|
||||||
|
labels:
|
||||||
|
traefik.enable: "true"
|
||||||
|
traefik.http.routers.qux-ws.entryPoints: "web_https"
|
||||||
|
traefik.http.routers.qux-ws.rule: "Host(`ws.{{ qux_domain }}`)"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
default:
|
||||||
|
name: servicenet
|
||||||
|
external: true
|
Loading…
Reference in a new issue