132 lines
5.7 KiB
Plaintext
132 lines
5.7 KiB
Plaintext
version: '3.6'
|
|
|
|
# Docker json-file rotation — quiet tier (~10MB cap per container).
|
|
x-logging-quiet: &fibitex-logging-quiet
|
|
driver: json-file
|
|
options:
|
|
max-size: "5m"
|
|
max-file: "2"
|
|
|
|
<%
|
|
app_host = "#{@config['app']['subdomain']}.#{@config['app']['domain']}"
|
|
shahoo_host = @config['app']['shahoo_host'].to_s.strip
|
|
shahoo_host = "#{@config['app']['shahoo_subdomain'] || 'shahoo'}.#{@config['app']['domain']}" if shahoo_host.empty?
|
|
shahoo_origin = "#{ssl_helper('http')}://#{shahoo_host}"
|
|
%>
|
|
|
|
services:
|
|
shahoo-bff:
|
|
logging: *fibitex-logging-quiet
|
|
restart: always
|
|
image: "<%= @config['images']['shahoo_bff'] %>"
|
|
environment:
|
|
PORT: "8082"
|
|
DALAN_URL: http://gateway:8099/api/v2/dalan
|
|
DENA_URL: http://gateway:8099/api/v2/dena
|
|
FIBITEX_HOST: "<%= app_host %>"
|
|
BARONG_URL: http://barong:8001
|
|
RANGER_PRIVATE_DIRECT_URL: ws://rango:8080/api/v2/ranger/private
|
|
SHAAHO_PUBLIC_URL: "<%= shahoo_origin %>"
|
|
CORS_ORIGIN: "<%= shahoo_origin %>,http://localhost:3000,http://127.0.0.1:3000"
|
|
REDIS_URL: "redis://redis:6379/1"
|
|
<% if @config.dig('dev', 'skip_api_key_2fa') -%>
|
|
SKIP_API_KEY_2FA: "true"
|
|
<% end -%>
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-q", "-O", "/dev/null", "http://127.0.0.1:8082/health"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 15s
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.shahoo-bff-<%= @name %>.rule=Host(`<%= shahoo_host %>`) && PathPrefix(`/api/1`)"
|
|
- "traefik.http.routers.shahoo-bff-<%= @name %>.priority=200"
|
|
- "traefik.http.services.shahoo-bff-<%= @name %>.loadbalancer.server.port=8082"
|
|
- "traefik.http.services.shahoo-bff-<%= @name %>.loadbalancer.healthcheck.path=/health"
|
|
- "traefik.http.services.shahoo-bff-<%= @name %>.loadbalancer.healthcheck.interval=15s"
|
|
- "traefik.http.services.shahoo-bff-<%= @name %>.loadbalancer.healthcheck.timeout=5s"
|
|
<%- if @config['ssl']['enabled'] -%>
|
|
- "traefik.http.routers.shahoo-bff-<%= @name %>.entrypoints=websecure"
|
|
- "traefik.http.routers.shahoo-bff-<%= @name %>.tls=true"
|
|
- "traefik.http.routers.shahoo-bff-<%= @name %>.tls.certresolver=letsencrypt"
|
|
<%- else -%>
|
|
- "traefik.http.routers.shahoo-bff-<%= @name %>.entrypoints=web"
|
|
<%- end -%>
|
|
|
|
shahoo:
|
|
logging: *fibitex-logging-quiet
|
|
restart: always
|
|
image: "<%= @config['images']['shahoo'] %>"
|
|
volumes:
|
|
- ../config/frontend/shahoo.env.js:/usr/share/nginx/html/config/env.js
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-q", "-O", "/dev/null", "http://127.0.0.1:3000/health"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 15s
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.shahoo-<%= @name %>.rule=Host(`<%= shahoo_host %>`) && PathPrefix(`/`)"
|
|
- "traefik.http.routers.shahoo-<%= @name %>.priority=100"
|
|
- "traefik.http.services.shahoo-<%= @name %>.loadbalancer.server.port=3000"
|
|
- "traefik.http.services.shahoo-<%= @name %>.loadbalancer.healthcheck.path=/health"
|
|
- "traefik.http.services.shahoo-<%= @name %>.loadbalancer.healthcheck.interval=15s"
|
|
- "traefik.http.services.shahoo-<%= @name %>.loadbalancer.healthcheck.timeout=5s"
|
|
<%- if @config['ssl']['enabled'] -%>
|
|
- "traefik.http.routers.shahoo-<%= @name %>.entrypoints=websecure"
|
|
- "traefik.http.routers.shahoo-<%= @name %>.tls=true"
|
|
- "traefik.http.routers.shahoo-<%= @name %>.tls.certresolver=letsencrypt"
|
|
<%- else -%>
|
|
- "traefik.http.routers.shahoo-<%= @name %>.entrypoints=web"
|
|
<%- end -%>
|
|
|
|
frontend:
|
|
logging: *fibitex-logging-quiet
|
|
restart: always
|
|
image: "<%= @config['images']['frontend'] %>"
|
|
volumes:
|
|
- ../config/frontend/env.js:/usr/share/nginx/html/config/env.js
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-q", "-O", "/dev/null", "http://127.0.0.1:3000/health"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 15s
|
|
labels:
|
|
- "traefik.http.routers.frontend-<%= @name %>.rule=Host(`<%= app_host %>`) && PathPrefix(`/`)"
|
|
- "traefik.enable=true"
|
|
- "traefik.http.services.frontend-<%= @name %>.loadbalancer.server.port=3000"
|
|
- "traefik.http.services.frontend-<%= @name %>.loadbalancer.healthcheck.path=/health"
|
|
- "traefik.http.services.frontend-<%= @name %>.loadbalancer.healthcheck.interval=15s"
|
|
- "traefik.http.services.frontend-<%= @name %>.loadbalancer.healthcheck.timeout=5s"
|
|
<%- if @config['ssl']['enabled'] -%>
|
|
- "traefik.http.routers.frontend-<%= @name %>.entrypoints=websecure"
|
|
- "traefik.http.routers.frontend-<%= @name %>.tls=true"
|
|
- "traefik.http.routers.frontend-<%= @name %>.tls.certresolver=letsencrypt"
|
|
<%- else -%>
|
|
- "traefik.http.routers.frontend-<%= @name %>.entrypoints=web"
|
|
<%- end -%>
|
|
|
|
AdminTower:
|
|
logging: *fibitex-logging-quiet
|
|
restart: always
|
|
image: "<%= @config['images']['tower'] %>"
|
|
volumes:
|
|
- ../config/frontend/tower.js:/home/app/env.js
|
|
labels:
|
|
- "traefik.http.routers.AdminTower-<%= @name %>.rule=Host(`<%= app_host %>`) && PathPrefix(`/tower`)"
|
|
- "traefik.enable=true"
|
|
- "traefik.http.services.AdminTower-<%= @name %>.loadbalancer.server.port=8080"
|
|
- "traefik.http.routers.AdminTower-<%= @name %>.middlewares=auth"
|
|
- "traefik.http.middlewares.auth.basicauth.users=yaser:{SHA}ueAuJOSpNyWTyI+JEiX57oeRevg="
|
|
# HaCE4UYTrCTck88uXkd9
|
|
<%- if @config['ssl']['enabled'] -%>
|
|
- "traefik.http.routers.AdminTower-<%= @name %>.entrypoints=websecure"
|
|
- "traefik.http.routers.AdminTower-<%= @name %>.tls=true"
|
|
- "traefik.http.routers.AdminTower-<%= @name %>.tls.certresolver=letsencrypt"
|
|
<%- else -%>
|
|
- "traefik.http.routers.AdminTower-<%= @name %>.entrypoints=web"
|
|
<%- end -%>
|