Files
karpenok 324327ee24
ansible-core-net / deploy (push) Successful in 25s
ansible-core-secrets / deploy (push) Successful in 10s
ansible-rus-central / deploy (push) Failing after 1m24s
feat(netbird): automate admin setup, API token, setup key, and LAN route on rus-central
2026-11-11 12:46:01 +07:00

155 lines
5.5 KiB
YAML

name: netbird
services:
traefik:
image: traefik:v3.7.14
container_name: netbird-traefik
restart: unless-stopped
networks:
netbird:
ipv4_address: 172.30.0.10
command:
- "--log.level=INFO"
- "--accesslog=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--providers.docker.network=netbird_netbird"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--entrypoints.websecure.allowACMEByPass=true"
- "--entrypoints.web.http.aliasHeadersStrategy=delete"
- "--entrypoints.websecure.http.aliasHeadersStrategy=delete"
- "--entrypoints.websecure.transport.respondingTimeouts.readTimeout=0"
- "--entrypoints.websecure.transport.respondingTimeouts.writeTimeout=0"
- "--entrypoints.websecure.transport.respondingTimeouts.idleTimeout=0"
- "--entrypoints.web.http.redirections.entrypoint.to=websecure"
- "--entrypoints.web.http.redirections.entrypoint.scheme=https"
- "--certificatesresolvers.letsencrypt.acme.email=${NETBIRD_LETSENCRYPT_EMAIL}"
- "--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json"
- "--certificatesresolvers.letsencrypt.acme.tlschallenge=true"
- "--serverstransport.forwardingtimeouts.responseheadertimeout=0s"
- "--serverstransport.forwardingtimeouts.idleconntimeout=0s"
- "--ping=true"
- "--ping.entrypoint=ping"
- "--entrypoints.ping.address=:8082"
ports:
- "443:443"
- "80:80"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- netbird_traefik_letsencrypt:/letsencrypt
healthcheck:
test: ["CMD", "traefik", "healthcheck", "--ping", "--ping.entrypoint=ping", "--entrypoints.ping.address=:8082"]
interval: 5s
timeout: 3s
retries: 10
start_period: 10s
logging:
driver: json-file
options:
max-size: "500m"
max-file: "2"
dashboard:
image: netbirdio/dashboard@sha256:340b13c00b84349572a2acc5605e907cb09250a9e6461c757097eabdb8e02f2c
container_name: netbird-dashboard
restart: unless-stopped
networks: [netbird]
env_file:
- ./dashboard.env
depends_on:
server-health:
condition: service_healthy
labels:
- traefik.enable=true
- traefik.http.routers.netbird-dashboard.rule=Host(`${NETBIRD_DOMAIN}`)
- traefik.http.routers.netbird-dashboard.entrypoints=websecure
- traefik.http.routers.netbird-dashboard.tls=true
- traefik.http.routers.netbird-dashboard.tls.certresolver=letsencrypt
- traefik.http.routers.netbird-dashboard.service=dashboard
- traefik.http.routers.netbird-dashboard.priority=1
- traefik.http.services.dashboard.loadbalancer.server.port=80
logging:
driver: json-file
options:
max-size: "500m"
max-file: "2"
dashboard-health:
image: curlimages/curl:8.22.0
network_mode: service:dashboard
depends_on:
dashboard:
condition: service_started
entrypoint: ["sleep", "infinity"]
healthcheck:
test: ["CMD", "curl", "-fsS", "http://127.0.0.1/"]
interval: 5s
timeout: 3s
retries: 10
start_period: 15s
restart: unless-stopped
netbird-server:
image: netbirdio/netbird-server:0.82.0
container_name: netbird-server
restart: unless-stopped
networks: [netbird]
environment:
- NB_SETUP_PAT_ENABLED=true
ports:
- "3478:3478/udp"
volumes:
- netbird_data:/var/lib/netbird
- ./config.yaml:/etc/netbird/config.yaml:ro
command: ["--config", "/etc/netbird/config.yaml"]
labels:
- traefik.enable=true
- traefik.http.routers.netbird-grpc.rule=Host(`${NETBIRD_DOMAIN}`) && (PathPrefix(`/signalexchange.SignalExchange/`) || PathPrefix(`/management.ManagementService/`) || PathPrefix(`/management.ProxyService/`))
- traefik.http.routers.netbird-grpc.entrypoints=websecure
- traefik.http.routers.netbird-grpc.tls=true
- traefik.http.routers.netbird-grpc.tls.certresolver=letsencrypt
- traefik.http.routers.netbird-grpc.service=netbird-server-h2c
- traefik.http.routers.netbird-grpc.priority=100
- traefik.http.routers.netbird-backend.rule=Host(`${NETBIRD_DOMAIN}`) && (PathPrefix(`/relay`) || PathPrefix(`/ws-proxy/`) || PathPrefix(`/api`) || PathPrefix(`/oauth2`))
- traefik.http.routers.netbird-backend.entrypoints=websecure
- traefik.http.routers.netbird-backend.tls=true
- traefik.http.routers.netbird-backend.tls.certresolver=letsencrypt
- traefik.http.routers.netbird-backend.service=netbird-server
- traefik.http.routers.netbird-backend.priority=100
- traefik.http.services.netbird-server.loadbalancer.server.port=80
- traefik.http.services.netbird-server-h2c.loadbalancer.server.port=80
- traefik.http.services.netbird-server-h2c.loadbalancer.server.scheme=h2c
logging:
driver: json-file
options:
max-size: "500m"
max-file: "2"
server-health:
image: curlimages/curl:8.22.0
network_mode: service:netbird-server
depends_on:
netbird-server:
condition: service_started
entrypoint: ["sleep", "infinity"]
healthcheck:
test: ["CMD", "curl", "-fsS", "http://127.0.0.1:80/oauth2/.well-known/openid-configuration"]
interval: 5s
timeout: 3s
retries: 12
start_period: 20s
restart: unless-stopped
volumes:
netbird_data:
netbird_traefik_letsencrypt:
networks:
netbird:
driver: bridge
ipam:
config:
- subnet: 172.30.0.0/24
gateway: 172.30.0.1