spaship
This commit is contained in:
@@ -62,9 +62,9 @@ jobs:
|
||||
-e SPRING_FLYWAY_PASSWORD=jambo_secret_pass \
|
||||
-e SPRING_DATA_MONGODB_URI=mongodb://jambotron_admin:jambo_mongo_secret@jambo-mongo:27017/jambotron?authSource=admin \
|
||||
-l "caddy=$D_DOMAIN, *.$D_DOMAIN, *.*.$D_DOMAIN" \
|
||||
-e SPACESHIP_API_KEY="${{ secrets.SPACESHIP_API_KEY }}" \
|
||||
-e SPACESHIP_API_SECRET="${{ secrets.SPACESHIP_API_SECRET }}" \
|
||||
-l "caddy.tls.dns=spaceship" \
|
||||
-l "caddy.tls.dns.spaceship.api_key=${{ secrets.SPACESHIP_API_KEY }}" \
|
||||
-l "caddy.tls.dns.spaceship.api_secret=${{ secrets.SPACESHIP_API_SECRET }}" \
|
||||
-l "caddy.reverse_proxy={{upstreams 8081}}" \
|
||||
jambotron-app:$D_TAG
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
# Используем builder для сборки кастомного бинарника
|
||||
FROM caddy:2.7-builder AS builder
|
||||
|
||||
RUN xcaddy build \
|
||||
--with github.com/caddy-dns/spaceship
|
||||
|
||||
# Финальный легковесный образ
|
||||
FROM caddy:2.7-alpine
|
||||
|
||||
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
|
||||
@@ -0,0 +1,10 @@
|
||||
# Используем специальный образ для сборки
|
||||
FROM lucaslorentz/caddy-docker-proxy:2.8-builder AS builder
|
||||
|
||||
RUN xcaddy build \
|
||||
--with github.com/caddy-dns/spaceship
|
||||
|
||||
# Финальный образ
|
||||
FROM lucaslorentz/caddy-docker-proxy:2.8-alpine
|
||||
|
||||
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
|
||||
@@ -0,0 +1,105 @@
|
||||
services:
|
||||
# --- ЯДРО: Caddy с авто-лейблами ---
|
||||
caddy:
|
||||
# Вместо image используем build
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile-caddy
|
||||
container_name: caddy
|
||||
ports:
|
||||
- 80:80
|
||||
- 443:443
|
||||
environment:
|
||||
- CADDY_INGRESS_NETWORKS=jambotron-net
|
||||
networks:
|
||||
- jambotron-net
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
- caddy_data:/data
|
||||
restart: always
|
||||
|
||||
# --- МОНИТОРИНГ: Prometheus ---
|
||||
prometheus:
|
||||
image: prom/prometheus:latest
|
||||
container_name: prometheus
|
||||
volumes:
|
||||
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
||||
- prometheus_data:/prometheus
|
||||
networks:
|
||||
- jambotron-net
|
||||
restart: always
|
||||
|
||||
# --- МОНИТОРИНГ: Grafana ---
|
||||
grafana:
|
||||
image: grafana/grafana:latest
|
||||
container_name: grafana
|
||||
networks:
|
||||
- jambotron-net
|
||||
environment:
|
||||
- GF_SECURITY_ADMIN_PASSWORD=monitorPWD
|
||||
- GF_SERVER_ROOT_URL=%(protocol)s://%(domain)s:%(http_port)s/monitor/
|
||||
- GF_SERVER_SERVE_FROM_SUB_PATH=true
|
||||
labels:
|
||||
caddy: jambotron.com
|
||||
caddy.handle: /monitor/*
|
||||
caddy.handle.reverse_proxy: "{{upstreams 3000}}"
|
||||
volumes:
|
||||
- grafana_data:/var/lib/grafana
|
||||
restart: always
|
||||
|
||||
# --- ДАТЧИКИ ---
|
||||
node-exporter:
|
||||
image: prom/node-exporter:latest
|
||||
container_name: node-exporter
|
||||
volumes:
|
||||
- /proc:/host/proc:ro
|
||||
- /sys:/host/sys:ro
|
||||
- /:/rootfs:ro
|
||||
command:
|
||||
- '--path.procfs=/host/proc'
|
||||
- '--path.sysfs=/host/sys'
|
||||
networks:
|
||||
- jambotron-net
|
||||
restart: always
|
||||
|
||||
cadvisor:
|
||||
image: gcr.io/cadvisor/cadvisor:latest
|
||||
container_name: cadvisor
|
||||
volumes:
|
||||
- /:/rootfs:ro
|
||||
- /var/run:/var/run:ro
|
||||
- /sys:/sys:ro
|
||||
- /var/lib/docker/:/var/lib/docker:ro
|
||||
- /dev/disk/:/dev/disk:ro
|
||||
networks:
|
||||
- jambotron-net
|
||||
restart: always
|
||||
|
||||
# --- ТЕСТОВЫЙ ПОДДОМЕН (Wildcard DNS должен быть включен) ---
|
||||
test-app1:
|
||||
image: traefik/whoami
|
||||
container_name: test-app1
|
||||
networks:
|
||||
- jambotron-net
|
||||
labels:
|
||||
caddy: test-app1.jambotron.com
|
||||
caddy.reverse_proxy: "{{upstreams 80}}"
|
||||
restart: always
|
||||
loki:
|
||||
image: grafana/loki:2.9.0
|
||||
container_name: jambo-loki
|
||||
ports:
|
||||
- "3100:3100"
|
||||
command: -config.file=/etc/loki/local-config.yaml
|
||||
networks:
|
||||
- jambotron-net
|
||||
restart: always
|
||||
|
||||
networks:
|
||||
jambotron-net:
|
||||
name: jambotron-net
|
||||
|
||||
volumes:
|
||||
caddy_data:
|
||||
prometheus_data:
|
||||
grafana_data:
|
||||
@@ -0,0 +1,15 @@
|
||||
global:
|
||||
scrape_interval: 15s
|
||||
|
||||
scrape_configs:
|
||||
- job_name: 'node'
|
||||
static_configs:
|
||||
- targets: ['node-exporter:9100']
|
||||
|
||||
- job_name: 'cadvisor'
|
||||
static_configs:
|
||||
- targets: ['cadvisor:8080']
|
||||
|
||||
- job_name: 'mongodb'
|
||||
static_configs:
|
||||
- targets: ['mongodb-exporter:9216']
|
||||
Reference in New Issue
Block a user