@@ -53,7 +53,9 @@ services:
5353 agent:
5454 networks:
5555 - monitored
56+ {%- raw %}
5657 hostname: " {{.Node.Hostname}}-{{.Service.Name}}"
58+ {%- endraw %}
5759 volumes:
5860 - /var /run /docker.sock: /var /run /docker.sock
5961 environment:
@@ -270,9 +272,10 @@ services:
270272 <<: *webserver_resources
271273 extra_hosts: []
272274
273-
274275 wb-db-event-listener:
276+ {%- raw %}
275277 hostname: " {{.Service.Name}}"
278+ {%- endraw %}
276279 environment:
277280 - WEBSERVER_LOGLEVEL =${WEBSERVER_LOGLEVEL}
278281 networks:
@@ -311,7 +314,9 @@ services:
311314 - default
312315 - interactive_services_subnet
313316 - monitored
317+ {%- raw %}
314318 hostname: "{{.Service.Name}}"
319+ {%- endraw %}
315320 deploy:
316321 update_config:
317322 parallelism: 2
@@ -538,7 +543,9 @@ services:
538543 cpus: ' 0.1 '
539544
540545 efs-guardian:
546+ {%- raw %}
541547 hostname: "{{.Service.Name}}"
548+ {% endraw %}
542549 networks:
543550 - monitored
544551 deploy:
@@ -644,7 +651,9 @@ services:
644651 networks:
645652 - monitored
646653 - public
654+ {%- raw %}
647655 hostname: "{{.Service.Name}}"
656+ {% endraw %}
648657 deploy:
649658 # NOTE: https://github.com/ITISFoundation/osparc-simcore/pull/4286
650659 # NOTE: this MUSTN' T change, or weird things might happen
@@ -768,6 +777,7 @@ services:
768777 reservations:
769778 memory: 128M
770779 cpus: ' 0.1'
780+
771781 traefik_api:
772782 # NOTE: this is a trick to allow to access the internal traefik REST API
773783 # A comment
@@ -813,6 +823,7 @@ services:
813823 reservations:
814824 memory: 8M
815825 cpus: ' 0.1'
826+
816827 whoami:
817828 image: " containous/whoami:v1.5.0"
818829 networks:
@@ -851,6 +862,7 @@ services:
851862 reservations:
852863 memory: 8M
853864 cpus: ' 0.1'
865+
854866 payments:
855867 deploy:
856868 placement:
@@ -894,9 +906,72 @@ services:
894906 - traefik.http.routers.${PREFIX_STACK_NAME}_dynamic_scheduler.tls =true
895907 - traefik.http.routers.${PREFIX_STACK_NAME}_dynamic_scheduler.middlewares =ops_gzip@swarm, ops_auth@swarm
896908
909+ fallback-service-web:
910+ image: nginx:1.25.1
911+ configs:
912+ - source: {{ SWARM_STACK_NAME }}_web_html
913+ target: /usr /share /nginx /html /503.html
914+ - source: {{ SWARM_STACK_NAME }}_web_nginx_config
915+ target: /etc /nginx /conf.d /default.conf
916+ networks:
917+ - public
918+ - monitored
919+ deploy:
920+ placement:
921+ constraints:
922+ - node.labels.simcore ==true
923+ update_config:
924+ order: start-first
925+ labels:
926+ - io.simcore.zone =${TRAEFIK_SIMCORE_ZONE}
927+ - traefik.enable =true
928+ - traefik.http.routers.fallback_html.priority =1
929+ - traefik.http.routers.fallback_html.rule =(Path( ` /`) || Path(` /v0`) || Path(` /socket.io /`) || Path(` /static-frontend-data.json`) || PathRegexp(`^ /study /(?P <study_uuid >\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b)`) || Path(`/view`) || Path(`/#/view`) || Path(`/#/error`) || PathPrefix(`/v0/`))
930+ - traefik.http.services.fallback_html.loadbalancer.server.port=80
931+ - traefik.http.routers.fallback_html.entrypoints=http
932+
933+ fallback-service-api:
934+ image: nginx:1.25.1
935+ configs:
936+ - source: {{ SWARM_STACK_NAME }}_api_json
937+ target: /usr/share/nginx/api/503.json
938+ - source: {{ SWARM_STACK_NAME }}_api_nginx_config
939+ target: /etc/nginx/conf.d/default.conf
940+ networks:
941+ - public
942+ - monitored
943+ deploy:
944+ placement:
945+ constraints:
946+ - node.labels.simcore==true
947+ update_config:
948+ order: start-first
949+ labels:
950+ - io.simcore.zone=${TRAEFIK_SIMCORE_ZONE}
951+ - traefik.enable=true
952+ - traefik.http.routers.fallback_api.priority=1
953+ - traefik.http.routers.fallback_api.rule=Path(`/`) || Path(`/v0`) || PathPrefix(`/v0/`) || Path(`/api/v0/openapi.json`)
954+ - traefik.http.services.fallback_api.loadbalancer.server.port=80
955+ - traefik.http.routers.fallback_api.entrypoints=simcore_api
956+
957+ configs:
958+ {{ SWARM_STACK_NAME }}_web_html:
959+ file: ./configs/fallback-service-nginx/web/503.html
960+ name: {{ SWARM_STACK_NAME}}_web_html_{{ "./configs/fallback-service-nginx/web/503.html" | sha256file | substring(0,10) }}
961+ {{ SWARM_STACK_NAME }}_api_json:
962+ file: ./configs/fallback-service-nginx/api/503.json
963+ name: {{ SWARM_STACK_NAME}}_api_json_{{ "./configs/fallback-service-nginx/api/503.json" | sha256file | substring(0,10) }}
964+ {{ SWARM_STACK_NAME }}_web_nginx_config:
965+ file: ./configs/fallback-service-nginx/web/default.conf
966+ name: {{ SWARM_STACK_NAME}}_web_nginx_config_{{ "./configs/fallback-service-nginx/web/default.conf" | sha256file | substring(0,10) }}
967+ {{ SWARM_STACK_NAME }}_api_nginx_config:
968+ file: ./configs/fallback-service-nginx/api/default.conf
969+ name: {{ SWARM_STACK_NAME}}_api_nginx_config_{{ "./configs/fallback-service-nginx/api/default.conf" | sha256file | substring(0,10) }}
970+
897971volumes:
898972 rabbit_data:
899973 name: ${SWARM_STACK_NAME}_rabbit_data
974+
900975networks:
901976 public:
902977 external: true
0 commit comments