sub2api/deploy/docker-entrypoint.sh
win ac0f69165c chore: restore docker-compose and entrypoint script to upstream
Removing LS-related environment variables and configurations:
- ANTIGRAVITY_LS_MODE
- ANTIGRAVITY_LS_PROXY / STRATEGY / REPLICAS
- GATEWAY_ANTIGRAVITY_LS_WORKER_* settings
- Docker socket mount for LS worker

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-04-09 00:43:23 +08:00

24 lines
778 B
Bash

#!/bin/sh
set -e
# Fix data directory permissions when running as root.
# Docker named volumes / host bind-mounts may be owned by root,
# preventing the non-root sub2api user from writing files.
if [ "$(id -u)" = "0" ]; then
mkdir -p /app/data
# Use || true to avoid failure on read-only mounted files (e.g. config.yaml:ro)
chown -R sub2api:sub2api /app/data 2>/dev/null || true
# Re-invoke this script as sub2api so the flag-detection below
# also runs under the correct user.
exec su-exec sub2api "$0" "$@"
fi
# Compatibility: if the first arg looks like a flag (e.g. --help),
# prepend the default binary so it behaves the same as the old
# ENTRYPOINT ["/app/sub2api"] style.
if [ "${1#-}" != "$1" ]; then
set -- /app/sub2api "$@"
fi
exec "$@"