FROM weishaw/sub2api:latest USER root # 兼容 Alpine / Debian RUN set -eux; \ if command -v apk >/dev/null 2>&1; then \ apk add --no-cache \ bash \ ca-certificates \ netcat-openbsd \ redis \ postgresql15 \ postgresql15-client \ su-exec; \ elif command -v apt-get >/dev/null 2>&1; then \ apt-get update && apt-get install -y --no-install-recommends \ bash \ ca-certificates \ netcat-openbsd \ redis-server \ postgresql \ postgresql-client \ gosu \ && rm -rf /var/lib/apt/lists/*; \ else \ echo "No supported package manager found in base image"; \ exit 1; \ fi ENV PORT=8080 \ HOST=0.0.0.0 \ PGDATA=/tmp/pgdata \ POSTGRES_DB=sub2api \ POSTGRES_USER=sub2api \ POSTGRES_PASSWORD=sub2api_pass \ REDIS_URL=redis://127.0.0.1:6379/0 COPY hf-entrypoint.sh /usr/local/bin/hf-entrypoint.sh RUN chmod +x /usr/local/bin/hf-entrypoint.sh EXPOSE 8080 ENTRYPOINT ["/usr/local/bin/hf-entrypoint.sh"]