x-logging: &default-logging driver: json-file options: max-size: "${DOCKER_LOG_MAX_SIZE:-20m}" max-file: "${DOCKER_LOG_MAX_FILES:-3}" services: web: build: context: . dockerfile: Dockerfile.web container_name: ${COMPOSE_PROJECT_NAME:-ios_headers}_web restart: unless-stopped env_file: - .env environment: CLICKHOUSE_HOST: clickhouse CLICKHOUSE_NATIVE_PORT: 9000 REDIS_HOST: redis REDIS_PORT: 6379 MINIO_ENDPOINT: minio:9000 MINIO_SECURE: "false" depends_on: clickhouse: condition: service_healthy redis: condition: service_healthy minio: condition: service_healthy healthcheck: test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8080/healthz', timeout=3)"] interval: 10s timeout: 5s retries: 20 start_period: 20s mem_limit: 256m mem_reservation: 160m logging: *default-logging nginx: image: nginx:1.27-alpine container_name: ${COMPOSE_PROJECT_NAME:-ios_headers}_nginx restart: unless-stopped ports: - "${WEB_PORT:-18080}:80" entrypoint: - /bin/sh - -ec command: - | hex="$(awk '$$2=="00000000" {print $$3; exit}' /proc/net/route)" if [ -n "$$hex" ] && [ "$${#hex}" -eq 8 ]; then o1=$$((16#$$(echo "$$hex" | cut -c7-8))) o2=$$((16#$$(echo "$$hex" | cut -c5-6))) o3=$$((16#$$(echo "$$hex" | cut -c3-4))) o4=$$((16#$$(echo "$$hex" | cut -c1-2))) export LOCAL_DEBUG_TRUSTED_ADDR="$$o1.$$o2.$$o3.$$o4" fi exec /docker-entrypoint.sh nginx -g 'daemon off;' environment: CDN_ORIGIN_VERIFY_SECRET: ${CDN_ORIGIN_VERIFY_SECRET:-} NGINX_ENVSUBST_FILTER: CDN_ORIGIN_VERIFY_SECRET|LOCAL_DEBUG_TRUSTED_ADDR volumes: - ./nginx/site.conf:/etc/nginx/templates/default.conf.template:ro - ./webroot:/webroot:ro depends_on: web: condition: service_healthy healthcheck: test: ["CMD", "curl", "-fsS", "http://localhost/healthz"] interval: 10s timeout: 5s retries: 20 start_period: 10s mem_limit: 128m mem_reservation: 64m logging: *default-logging frpc: image: ghcr.io/fatedier/frpc:v0.61.2 container_name: ${COMPOSE_PROJECT_NAME:-ios_headers}_frpc profiles: ["tunnel"] restart: on-failure depends_on: nginx: condition: service_healthy environment: FRP_SERVER_ADDR: ${FRP_SERVER_ADDR:-} FRP_SERVER_PORT: ${FRP_SERVER_PORT:-7000} FRP_TOKEN: ${FRP_TOKEN:-} FRP_PROXY_NAME: ${FRP_PROXY_NAME:-ios-headers-web} FRP_REMOTE_PORT: ${FRP_REMOTE_PORT:-18080} entrypoint: - /bin/sh - -ec command: - | if [ -z "$$FRP_SERVER_ADDR" ]; then echo "FRP_SERVER_ADDR is empty; frpc disabled" exit 0 fi [ -n "$$FRP_TOKEN" ] || { echo "FRP_TOKEN is required"; exit 1; } cat >/tmp/frpc.toml <