Files
infra-docker-configs/servers/bwh-hk-cmi/sing-box/compose.yaml
T

52 lines
1.4 KiB
YAML

services:
config-render:
image: alpine:3.24
environment:
DOMAIN: ${DOMAIN}
ANYTLS_DOMAIN: ${ANYTLS_DOMAIN}
ACME_EMAIL: ${ACME_EMAIL}
LISTEN_PORT: ${LISTEN_PORT}
USER1_PASSWORD: ${USER1_PASSWORD}
CLOUDFLARE_API_TOKEN: ${CLOUDFLARE_API_TOKEN}
ANYTLS_PORT: ${ANYTLS_PORT}
ANYTLS_PASSWORD: ${ANYTLS_PASSWORD}
HY2_PASSWORD: ${HY2_PASSWORD}
HY2_OBFS_PASSWORD: ${HY2_OBFS_PASSWORD}
HY2_PORT: ${HY2_PORT}
SNELL_V4_PORT: ${SNELL_V4_PORT}
SNELL_V4_PSK: ${SNELL_V4_PSK}
SNELL_V6_PORT: ${SNELL_V6_PORT}
SNELL_V6_PSK: ${SNELL_V6_PSK}
volumes:
- ./etc/sing-box/config.json.template:/template/config.json.template:ro
- sing-box-config:/output
command:
- /bin/sh
- -ec
- |
apk add --no-cache gettext
envsubst < /template/config.json.template > /output/config.json
chmod 600 /output/config.json
restart: "no"
sing-box:
image: ghcr.io/sagernet/sing-box:v1.14.0
restart: unless-stopped
depends_on:
config-render:
condition: service_completed_successfully
volumes:
- sing-box-config:/etc/sing-box:ro
- sing-box-data:/var/lib/sing-box
command: -D /var/lib/sing-box -C /etc/sing-box/ run
network_mode: host
logging:
driver: json-file
options:
max-size: 200k
max-file: "2"
volumes:
sing-box-config:
sing-box-data: