Spaces:
Paused
Paused
File size: 1,111 Bytes
0deb6d2 83e4cde 0deb6d2 83e4cde | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | 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"] |