Initial commit

This commit is contained in:
Yaser
2026-08-13 19:42:08 +03:30
commit d59bf30ef0
173 changed files with 11702 additions and 0 deletions

View File

@@ -0,0 +1,77 @@
version: '3.6'
# Docker json-file rotation — noisy tier (~30MB cap per container).
x-logging-noisy: &fibitex-logging-noisy
driver: json-file
options:
max-size: "10m"
max-file: "3"
services:
peatio:
logging: *fibitex-logging-noisy
restart: always
image: "<%= @config['images']['peatio'] %>"
environment:
- VAULT_TOKEN=${PEATIO_RAILS_VAULT_TOKEN}
env_file:
- ../config/peatio.env
expose:
- "8000"
volumes:
- ../config/peatio/seed:/opt/peatio/config/seed
- ../config/peatio/management_api_v1.yml:/opt/peatio/config/management_api_v1.yml
- ../config/peatio/application.yml:/opt/peatio/config/application.yml
- ../config/peatio/plugins.yml:/opt/peatio/config/plugins.yml
- ../config/peatio/abilities.yml:/opt/peatio/config/abilities.yml
- ../config/test_users.yml:/opt/peatio/config/test_users.yml
- ../bin/seed_test_balances.rb:/home/app/lib/seed_test_balances.rb
- ../bin/check_test_balances.rb:/home/app/lib/check_test_balances.rb
- ../bin/sync_peatio_seed.rb:/home/app/lib/sync_peatio_seed.rb
labels: {}
command: bash -c "ruby ./bin/link_config && bundle exec puma --config config/puma.rb"
barong:
logging: *fibitex-logging-noisy
restart: always
image: "<%= @config['images']['barong'] %>"
env_file:
- ../config/barong.env
volumes:
- ../config/secrets:/secrets:ro
- ../config/barong/seeds.yml:/home/app/config/seeds.yml
- ../config/barong/barong.yml:/home/app/config/barong.yml
- ../config/barong/authz_rules.yml:/home/app/config/authz_rules.yml
- ../config/barong/management_api.yml:/home/app/config/management_api.yml
- ../config/barong/abilities.yml:/home/app/config/abilities.yml
- ../config/test_users.yml:/home/app/config/test_users.yml
- ../bin/seed_test_users.rb:/home/app/lib/seed_test_users.rb
<% if @config['finex']['enabled'] %>
finex-api:
logging: *fibitex-logging-noisy
restart: always
image: "<%= @config['finex']['image'] %>"
command: "./orderapi"
volumes:
- ../config/finex:/app/config:ro
finex-engine:
logging: *fibitex-logging-noisy
restart: always
image: "<%= @config['finex']['image'] %>"
command: "./finex"
volumes:
- ../config/finex:/app/config:ro
<% end %>
applogic:
logging: *fibitex-logging-noisy
restart: always
image: "<%= @utils['images']['applogic'] %>"
env_file:
- ../config/applogic.env
expose:
- "8081"
volumes:
- ../config/applogic/management_api_v2.yml:/home/app/config/management_api_v2.yml

View File

@@ -0,0 +1,18 @@
version: '3.6'
x-logging-noisy: &fibitex-logging-noisy
driver: json-file
options:
max-size: "10m"
max-file: "3"
services:
arke-maker:
logging: *fibitex-logging-noisy
restart: always
image: "<%= @utils['images']['arke'] %>"
env_file:
- ../config/arke.env
volumes:
- ../config/arke/strategies.yml:/home/app/config/strategies.yml
command: bundle exec ./bin/arke start

View File

@@ -0,0 +1,79 @@
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"
services:
db:
logging: *fibitex-logging-quiet
restart: always
<%- if @config['database']['adapter'] == 'mysql' %>
image: mysql:8.0.36
command: --default-authentication-plugin=mysql_native_password
volumes:
- db_data:/var/lib/mysql
- ../config/mysql:/etc/mysql/conf.d:ro
environment:
MYSQL_ROOT_PASSWORD: <%= @config['database']['password'] %>
<%- elsif @config['database']['adapter'] == 'postgresql' %>
image: postgres:13
volumes:
- db_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: <%= @config['database']['user'] %>
POSTGRES_PASSWORD: <%= @config['database']['password'] %>
<%- end %>
influxdb:
logging: *fibitex-logging-quiet
image: influxdb:1.7.10
restart: always
volumes:
- influx_data:/var/lib/influxdb
- ../config/influxdb/build_candles.sql:/build_candles.sql
- ../config/influxdb/arke.sql:/arke.sql
- ../config/influxdb/peatio.sql:/peatio.sql
- ../config/arke/historical_data:/data/historical_data
environment:
INFLUXDB_ADMIN_ENABLED: "true"
INFLUXDB_LOGGING_LEVEL: "warn"
redis:
logging: *fibitex-logging-quiet
image: redis:7.2.12-alpine
restart: always
volumes:
- redis_data:/data
rabbitmq:
logging: *fibitex-logging-quiet
image: rabbitmq:3.7.6-management
restart: always
volumes:
- rabbitmq_data:/var/lib/rabbitmq
vault:
logging: *fibitex-logging-quiet
image: vault:1.3.0
restart: always
volumes:
- vault_data:/vault
- ../config/vault:/tmp/policies
command:
- server
cap_add:
- IPC_LOCK
environment:
VAULT_LOCAL_CONFIG: '{"storage": {"file": { "path": "/vault/data" }}, "listener": {"tcp":{"address": "0.0.0.0:8200","tls_disable":"1"}}}'
VAULT_ADDR: http://vault:8200
volumes:
db_data:
rabbitmq_data:
redis_data:
vault_data:
influx_data:

View File

@@ -0,0 +1,49 @@
version: '3.6'
x-logging-noisy: &fibitex-logging-noisy
driver: json-file
options:
max-size: "10m"
max-file: "3"
services:
parity:
logging: *fibitex-logging-noisy
image: parity/parity:v2.7.2-stable
restart: always
command: |
--chain=kovan
--mode=active
--interface=all
--warp=true
--snapshot-peers=10
--min-peers=5
--max-peers=10
--jsonrpc-interface=0.0.0.0
--jsonrpc-cors=all
--jsonrpc-hosts=all
--jsonrpc-apis=all
--db-compaction=ssd
--no-persistent-txqueue
volumes:
- ../data/parity:/home/parity/.local/share/io.parity.ethereum
ports:
- "127.0.0.1:8545:8545"
bitcoind:
logging: *fibitex-logging-noisy
image: quay.io/openware/bitcoind:0.19.1
restart: always
user: root
command: bitcoind
volumes:
- ../data/bitcoin:/bitcoin
- ../config/bitcoin.conf:/bitcoin/.bitcoin/bitcoin.conf
litecoind:
logging: *fibitex-logging-noisy
image: quay.io/openware/litecoind:0.16.3
restart: always
volumes:
- ../data/litecoin:/litecoin
- ../config/litecoin.conf:/litecoin/litecoin.conf

View File

@@ -0,0 +1,141 @@
version: '3.6'
# Docker json-file rotation.
x-logging-noisy: &fibitex-logging-noisy
driver: json-file
options:
max-size: "10m"
max-file: "3"
x-logging-quiet: &fibitex-logging-quiet
driver: json-file
options:
max-size: "5m"
max-file: "2"
x-daemon: &peatio-daemon
image: "<%= @config['images']['peatio'] %>"
restart: always
logging: *fibitex-logging-noisy
env_file:
- ../config/peatio.env
volumes:
- ../config/peatio:/opt/peatio/config:ro
services:
blockchain:
<< : *peatio-daemon
command: bash -c "ruby ./bin/link_config && bundle exec ruby lib/daemons/daemons.rb blockchain"
cron_job:
<< : *peatio-daemon
environment:
- VAULT_TOKEN=${PEATIO_CRYPTO_VAULT_TOKEN}
command: bash -c "ruby ./bin/link_config && bundle exec ruby lib/daemons/daemons.rb cron_job"
deposit:
<< : *peatio-daemon
environment:
- VAULT_TOKEN=${PEATIO_CRYPTO_VAULT_TOKEN}
command: bash -c "ruby ./bin/link_config && bundle exec ruby lib/daemons/daemons.rb deposit"
upstream:
<< : *peatio-daemon
environment:
- VAULT_TOKEN=${PEATIO_UPSTREAM_VAULT_TOKEN}
command: bash -c "ruby ./bin/link_config && bundle exec ruby lib/daemons/daemons.rb upstream"
deposit_coin_address:
<< : *peatio-daemon
environment:
- VAULT_TOKEN=${PEATIO_CRYPTO_VAULT_TOKEN}
command: bash -c "ruby ./bin/link_config && bundle exec ruby lib/daemons/amqp_daemon.rb deposit_coin_address"
withdraw_coin:
<< : *peatio-daemon
environment:
- VAULT_TOKEN=${PEATIO_CRYPTO_VAULT_TOKEN}
command: bash -c "ruby ./bin/link_config && bundle exec ruby lib/daemons/amqp_daemon.rb withdraw_coin"
influx_writer:
<< : *peatio-daemon
command: bash -c "ruby ./bin/link_config && bundle exec ruby lib/daemons/amqp_daemon.rb influx_writer"
rango:
logging: *fibitex-logging-noisy
restart: always
image: "<%= @config['images']['rango'] %>"
env_file:
- ../config/rango.env
<% unless @config['finex']['enabled'] %>
matching:
<< : *peatio-daemon
environment:
- VAULT_TOKEN=${PEATIO_MATCHING_VAULT_TOKEN}
command: bash -c "ruby ./bin/link_config && bundle exec ruby lib/daemons/amqp_daemon.rb matching"
order_processor:
<< : *peatio-daemon
environment:
- VAULT_TOKEN=${PEATIO_MATCHING_VAULT_TOKEN}
command: bash -c "ruby ./bin/link_config && bundle exec ruby lib/daemons/amqp_daemon.rb order_processor"
trade_executor:
<< : *peatio-daemon
environment:
- VAULT_TOKEN=${PEATIO_MATCHING_VAULT_TOKEN}
command: bash -c "ruby ./bin/link_config && bundle exec ruby lib/daemons/amqp_daemon.rb trade_executor"
<% end %>
mailer:
logging: *fibitex-logging-quiet
restart: always
image: "<%= @config['images']['barong'] %>"
env_file:
- ../config/barong.env
volumes:
- ../config/secrets:/secrets:ro
- ../config/mailer/templates:/home/app/app/views/postmaster
- ../config/mailer.yml:/home/app/config/mailer.yml
- ../config/barong/seeds.yml:/home/app/config/seeds.yml
- ../config/barong/barong.yml:/home/app/config/barong.yml
- ../config/barong/authz_rules.yml:/home/app/config/authz_rules.yml
- ../config/barong/management_api.yml:/home/app/config/management_api.yml
- ../config/barong/abilities.yml:/home/app/config/abilities.yml
command: bash -c "bin/mailer run"
applogic_sidekiq:
logging: *fibitex-logging-noisy
restart: always
image: "<%= @utils['images']['applogic'] %>"
env_file:
- ../config/barong.env
volumes:
- ../config/applogic/management_api_v2.yml:/home/app/config/management_api_v2.yml
- ../config/applogic/schedule.yml:/home/app/config/schedule.yml
command: bash -c "bundle exec sidekiq"
barong_sidekiq:
logging: *fibitex-logging-noisy
restart: always
image: "<%= @config['images']['barong'] %>"
env_file:
- ../config/barong.env
volumes:
- ../config/secrets:/secrets:ro
- ../config/barong/seeds.yml:/home/app/config/seeds.yml
- ../config/barong/barong.yml:/home/app/config/barong.yml
- ../config/barong/authz_rules.yml:/home/app/config/authz_rules.yml
- ../config/barong/management_api.yml:/home/app/config/management_api.yml
command: bash -c "bundle exec sidekiq"
listener:
logging: *fibitex-logging-noisy
restart: always
image: "<%= @utils['images']['applogic'] %>"
env_file:
- ../config/applogic.env
volumes:
- ../config/applogic/management_api_v2.yml:/home/app/config/management_api_v2.yml
command: bash -c "bundle exec rake event_api_listener"

View File

@@ -0,0 +1,131 @@
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 -%>

View File

@@ -0,0 +1,45 @@
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?
%>
services:
gateway:
logging: *fibitex-logging-quiet
restart: always
image: envoyproxy/envoy:v1.10.0
volumes:
- ../config/gateway:/etc/envoy/
command: /usr/local/bin/envoy -l info -c /etc/envoy/envoy.yaml
labels:
- "traefik.http.routers.gateway-<%= @name %>.rule=Host(`<%= app_host %>`) && (PathPrefix(`/api`) || PathPrefix(`/admin`) || PathPrefix(`/assets/`))"
- "traefik.enable=true"
- "traefik.http.services.gateway-<%= @name %>.loadbalancer.server.port=8099"
<%- if @config['ssl']['enabled'] -%>
- "traefik.http.routers.gateway-<%= @name %>.entrypoints=websecure"
- "traefik.http.routers.gateway-<%= @name %>.tls=true"
- "traefik.http.routers.gateway-<%= @name %>.tls.certresolver=letsencrypt"
<%- else -%>
- "traefik.http.routers.gateway-<%= @name %>.entrypoints=web"
<%- end -%>
# WS0.2 — Rango on shahoo.* (same Envoy cluster as www)
- "traefik.http.routers.gateway-shahoo-ranger-<%= @name %>.rule=Host(`<%= shahoo_host %>`) && PathPrefix(`/api/v2/ranger`)"
- "traefik.http.routers.gateway-shahoo-ranger-<%= @name %>.priority=250"
- "traefik.http.routers.gateway-shahoo-ranger-<%= @name %>.service=gateway-<%= @name %>"
<%- if @config['ssl']['enabled'] -%>
- "traefik.http.routers.gateway-shahoo-ranger-<%= @name %>.entrypoints=websecure"
- "traefik.http.routers.gateway-shahoo-ranger-<%= @name %>.tls=true"
- "traefik.http.routers.gateway-shahoo-ranger-<%= @name %>.tls.certresolver=letsencrypt"
<%- else -%>
- "traefik.http.routers.gateway-shahoo-ranger-<%= @name %>.entrypoints=web"
<%- end -%>

View File

@@ -0,0 +1,186 @@
version: '3.6'
x-logging-quiet: &fibitex-logging-quiet
driver: json-file
options:
max-size: "5m"
max-file: "2"
services:
prometheus:
logging: *fibitex-logging-quiet
image: prom/prometheus:latest
container_name: monitoring-prometheus
volumes:
- ../config/monitoring/prometheus:/etc/prometheus/
- prometheus:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
- '--web.enable-lifecycle'
labels:
- "traefik.enable=true"
- "traefik.http.routers.pro-<%= @name %>.entrypoints=http"
- "traefik.http.routers.pro-<%= @name %>.rule=Host(`pro.<%= @config['app']['domain'] %>`)"
- "traefik.http.services.pro-<%= @name %>.loadbalancer.server.port=9090"
- "traefik.http.routers.pro-<%= @name %>.middlewares=auth"
- "traefik.http.middlewares.auth.basicauth.users=yaser:{SHA}ueAuJOSpNyWTyI+JEiX57oeRevg="
# HaCE4UYTrCTck88uXkd9
<%- if @config['ssl']['enabled'] -%>
- "traefik.http.routers.pro-<%= @name %>.entrypoints=websecure"
- "traefik.http.routers.pro-<%= @name %>.tls=true"
- "traefik.http.routers.pro-<%= @name %>.tls.certresolver=letsencrypt"
<%- else -%>
- "traefik.http.routers.pro-<%= @name %>.entrypoints=web"
<%- end -%>
grafana:
logging: *fibitex-logging-quiet
image: grafana/grafana
container_name: monitoring-grafana
depends_on:
- prometheus
volumes:
- grafana:/var/lib/grafana
environment:
- GF_INSTALL_PLUGINS=https://github.com/raintank/crate-datasource/archive/master.zip;crate-datasource,grafana-clock-panel,grafana-worldmap-panel,natel-plotly-panel,grafana-piechart-panel
labels:
- "traefik.enable=true"
- "traefik.http.routers.gra-<%= @name %>.entrypoints=http"
- "traefik.http.routers.gra-<%= @name %>.rule=Host(`gra.<%= @config['app']['domain'] %>`)"
- "traefik.http.services.gra-<%= @name %>.loadbalancer.server.port=3000"
<%- if @config['ssl']['enabled'] -%>
- "traefik.http.routers.gra-<%= @name %>.entrypoints=websecure"
- "traefik.http.routers.gra-<%= @name %>.tls=true"
- "traefik.http.routers.gra-<%= @name %>.tls.certresolver=letsencrypt"
<%- else -%>
- "traefik.http.routers.gra-<%= @name %>.entrypoints=web"
<%- end -%>
alertmanager:
logging: *fibitex-logging-quiet
image: prom/alertmanager
container_name: monitoring-alertmanager
volumes:
- ../config/monitoring/alertmanager/:/etc/alertmanager/
command:
- '--config.file=/etc/alertmanager/config.yml'
- '--storage.path=/alertmanager'
labels:
- "traefik.enable=true"
- "traefik.http.routers.ale-<%= @name %>.entrypoints=http"
- "traefik.http.routers.ale-<%= @name %>.rule=Host(`alert.<%= @config['app']['domain'] %>`)"
- "traefik.http.services.ale-<%= @name %>.loadbalancer.server.port=9093"
- "traefik.http.routers.ale-<%= @name %>.middlewares=auth"
- "traefik.http.middlewares.auth.basicauth.users=yaser:{SHA}ueAuJOSpNyWTyI+JEiX57oeRevg="
# HaCE4UYTrCTck88uXkd9
<%- if @config['ssl']['enabled'] -%>
- "traefik.http.routers.ale-<%= @name %>.entrypoints=websecure"
- "traefik.http.routers.ale-<%= @name %>.tls=true"
- "traefik.http.routers.ale-<%= @name %>.tls.certresolver=letsencrypt"
<%- else -%>
- "traefik.http.routers.ale.entrypoints=web"
<%- end -%>
loki:
logging: *fibitex-logging-quiet
image: grafana/loki:latest
container_name: monitoring-loki
command: -config.file=/etc/loki/local-config.yaml
volumes:
- loki:/tmp/loki
- ../config/monitoring/loki/local-config.yaml:/etc/loki/local-config.yaml
labels:
- "traefik.enable=true"
- "traefik.http.routers.lok-<%= @name %>.entrypoints=http"
- "traefik.http.routers.lok-<%= @name %>.rule=Host(`loki.<%= @config['app']['domain'] %>`)"
- "traefik.http.services.lok-<%= @name %>.loadbalancer.server.port=3100"
<%- if @config['ssl']['enabled'] -%>
- "traefik.http.routers.lok-<%= @name %>.entrypoints=websecure"
- "traefik.http.routers.lok-<%= @name %>.tls=true"
- "traefik.http.routers.lok-<%= @name %>.tls.certresolver=letsencrypt"
<%- else -%>
- "traefik.http.routers.lok-<%= @name %>.entrypoints=web"
<%- end -%>
scope:
logging: *fibitex-logging-quiet
image: weaveworks/scope:latest
pid: "host"
privileged: true
container_name: monitoring-scope
labels:
- "traefik.enable=true"
- "traefik.http.routers.scop-<%= @name %>.entrypoints=http"
- "traefik.http.routers.scop-<%= @name %>.rule=Host(`scope.<%= @config['app']['domain'] %>`)"
- "traefik.http.services.scop-<%= @name %>.loadbalancer.server.port=4040"
- "traefik.http.routers.scop-<%= @name %>.middlewares=auth"
- "traefik.http.middlewares.auth.basicauth.users=yaser:{SHA}ueAuJOSpNyWTyI+JEiX57oeRevg="
# HaCE4UYTrCTck88uXkd
<%- if @config['ssl']['enabled'] -%>
- "traefik.http.routers.scop-<%= @name %>.entrypoints=websecure"
- "traefik.http.routers.scop-<%= @name %>.tls=true"
- "traefik.http.routers.scop-<%= @name %>.tls.certresolver=letsencrypt"
<%- else -%>
- "traefik.http.routers.scop-<%= @name %>.entrypoints=web"
<%- end -%>
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:rw"
command:
- "--probe.docker=true"
node-exporter:
logging: *fibitex-logging-quiet
image: prom/node-exporter:latest
container_name: monitoring-node-exporter
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- --path.procfs=/host/proc
- --path.sysfs=/host/sys
- --collector.filesystem.ignored-mount-points
- ^/(sys|proc|dev|host|etc|rootfs/var/lib/docker/containers|rootfs/var/lib/docker/overlay2|rootfs/run/docker/netns|rootfs/var/lib/docker/aufs)($$|/)
ports:
- 9100:9100
cadvisor:
logging: *fibitex-logging-quiet
image: google/cadvisor:latest
container_name: monitoring-cadvisor
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /dev/disk/:/dev/disk:ro
ports:
<%- if @config['serverip']['enabled'] -%>
- "<%= @config['serverip']['ip'] %>:8080:8080"
<%- else -%>
- 8080:8080
<%- end -%>
promtail:
logging: *fibitex-logging-quiet
image: grafana/promtail:latest
container_name: monitoring-promtail
volumes:
- /var/log:/var/log
- ../config/monitoring/promtail/docker-config.yaml:/etc/promtail/docker-config.yaml
command: -config.file=/etc/promtail/docker-config.yaml
ports:
- 9080:9080
volumes:
grafana:
name: grafana
prometheus:
name: prometheus
loki:
name: loki

View File

@@ -0,0 +1,81 @@
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"
services:
proxy:
logging: *fibitex-logging-quiet
restart: always
image: traefik:latest
ports:
<%- if @config['serverip']['enabled'] -%>
- "<%= @config['serverip']['ip'] %>:80:80"
- "<%= @config['serverip']['ip'] %>:443:443"
<%- else -%>
- "80:80"
- "443:443"
<%- end -%>
volumes:
- /var/run/docker.sock:/var/run/docker.sock
<%- if @config['ssl']['enabled'] -%>
- ../config/acme.json:/letsencrypt/acme.json
<%- end -%>
command:
- --log.level=INFO
- --api.dashboard=true <%#OK%>
- --providers.docker=true <%#OK%>
- --providers.docker.exposedbydefault=false
- --entryPoints.web.address=:80 <%#OK%>
<%- if @config['ssl']['enabled'] -%>
- --certificatesresolvers.letsencrypt.acme.email=<%= @config['ssl']['email'] %> <%#OK%>
- --certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json <%#OK%>
- --certificatesresolvers.letsencrypt.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory
- --entrypoints.web.http.redirections.entrypoint.to=websecure <%#OK%>
- --entrypoints.web.http.redirections.entrypoint.scheme=https <%#OK%>
- --entrypoints.websecure.address=:443 <%#OK%>
- --entrypoints.websecure.http.tls=true <%#OK%>
- --entrypoints.websecure.http.tls.certResolver=letsencrypt <%#OK%>
<%# - "--entryPoints.websecure.forwardedHeaders.insecure" %>
<%# - "--certificatesresolvers.letsencrypt.acme.httpchallenge=true"
- "--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web" %>
# Un comment bllow 4 line for request to ssl cert. For now we use universal cloudflare cert
<%# - --certificatesresolvers.letsencrypt.acme.dnschallenge=true
- --certificatesresolvers.letsencrypt.acme.dnschallenge.provider=cloudflare %>
<%# environment:
- CF_API_EMAIL=yaser.rezaei@gmail.com
- CF_API_KEY=b988f91ef34cea523436d293f14c327be282e %>
labels:
- "traefik.enable=true"
- "traefik.http.routers.http-catchall.rule=hostregexp(`{host:[a-z-.]+}`)"
- "traefik.http.routers.http-catchall.entrypoints=web"
- "traefik.http.routers.http-catchall.middlewares=redirect-to-https"
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
- "traefik.http.middlewares.redirect-to-https.redirectscheme.permanent=true"
# dashboard Setting
- "traefik.http.routers.dashboard.rule=Host(`tra.<%= @config['app']['domain'] %>`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
- "traefik.http.routers.dashboard.service=api@internal"
- "traefik.http.routers.dashboard.middlewares=auth"
- "traefik.http.middlewares.auth.basicauth.users=yaser:{SHA}ueAuJOSpNyWTyI+JEiX57oeRevg="
# HaCE4UYTrCTck88uXkd9
- "traefik.http.routers.dashboard.tls=true"
- "traefik.http.routers.dashboard.tls.certresolver=letsencrypt"
# global redirect to https
- "traefik.http.routers.redirs.rule=hostregexp(`{host:.+}`)"
- "traefik.http.routers.redirs.entrypoints=web"
- "traefik.http.routers.redirs.middlewares=redirect-to-https"
<%- end -%>

View File

@@ -0,0 +1,29 @@
version: '3.6'
x-logging-quiet: &fibitex-logging-quiet
driver: json-file
options:
max-size: "5m"
max-file: "2"
services:
superset:
logging: *fibitex-logging-quiet
image: "<%= @utils['images']['superset'] %>"
restart: always
volumes:
- superset_db:/var/lib/superset
labels:
- "traefik.http.routers.superset-<%= @name %>.rule=Host(`superset.<%= @config['app']['domain'] %>`)"
- "traefik.http.services.superset-<%= @name %>.loadbalancer.server.port=8088"
- "traefik.enable=true"
<%- if @config['ssl']['enabled'] -%>
- "traefik.http.routers.superset-<%= @name %>.entrypoints=websecure"
- "traefik.http.routers.superset-<%= @name %>.tls=true"
- "traefik.http.routers.superset-<%= @name %>.tls.certresolver=letsencrypt"
<%- else -%>
- "traefik.http.routers.superset-<%= @name %>.entrypoints=web"
<%- end -%>
volumes:
superset_db:

View File

@@ -0,0 +1,34 @@
version: '3.6'
x-logging-quiet: &fibitex-logging-quiet
driver: json-file
options:
max-size: "5m"
max-file: "2"
services:
frontend:
logging: *fibitex-logging-quiet
image: node:11
restart: always
user: "${UID}:${GID}"
volumes:
- ../vendor/frontend:/home/node
command:
- sh
- -c
- |
cd /home/node
yarn
yarn start
labels:
- "traefik.http.routers.frontend-<%= @name %>.rule=Host(`<%= @config['app']['subdomain'] %>.<%= @config['app']['domain'] %>`) && PathPrefix(`/`)"
- "traefik.http.services.frontend-<%= @name %>.loadbalancer.server.port=3000"
- "traefik.enable=true"
<%- 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 -%>