Spaces:
Running
Running
Download Dockerfile from xingshang3084/sub2api: direct link, hf CLI and curl.
- Browser
- Download file 1.74 kB
-
https://huggingface.co/spaces/xingshang3084/sub2api/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/xingshang3084/sub2api/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/xingshang3084/sub2api/resolve/main/Dockerfile
1.74 kB
| FROM postgres:17-alpine AS sub2api-release | |
| RUN apk add --no-cache ca-certificates curl | |
| WORKDIR /release | |
| ARG SUB2API_RELEASE_URL=https://github.com/Wei-Shaw/sub2api/releases/download/v0.2.25/sub2api_0.2.25_linux_amd64.tar.gz | |
| RUN set -eux; \ | |
| curl --fail --location --retry 4 --retry-all-errors --connect-timeout 20 --max-time 600 \ | |
| "$SUB2API_RELEASE_URL" \ | |
| --output release.tar.gz; \ | |
| printf '%s %s\n' '6ecd6a034e1b4db971dc00d5b4547e978bc9b9cf79b5921a630fd7cdb5e6712f' 'release.tar.gz' | sha256sum -c -; \ | |
| tar -xzf release.tar.gz sub2api; \ | |
| printf '%s %s\n' '827c2aa60b24fa77dc9467f328e092b54c08b8a632f2e3dda5cdfc072be3b8aa' 'sub2api' | sha256sum -c -; \ | |
| chmod 755 sub2api | |
| FROM postgres:17-alpine | |
| USER root | |
| RUN apk add --no-cache \ | |
| ca-certificates \ | |
| tzdata \ | |
| redis \ | |
| su-exec \ | |
| tar \ | |
| gzip \ | |
| openssl | |
| RUN addgroup -S app && \ | |
| adduser -S -G app -s /bin/sh app | |
| WORKDIR /tmp/payload | |
| COPY bundle.tar.gz /tmp/payload/bundle.tar.gz | |
| RUN set -eux; \ | |
| tar -xzf /tmp/payload/bundle.tar.gz; \ | |
| mkdir -p /app/data; \ | |
| cp /tmp/payload/runtime/boot.sh /app/boot.sh; \ | |
| cp -R /tmp/payload/runtime/resources /app/resources; \ | |
| chmod +x /app/boot.sh | |
| COPY --from=sub2api-release /release/sub2api /app/server | |
| COPY model_prices_and_context_window.json /app/resources/model-pricing/model_prices_and_context_window.json | |
| RUN printf '%s %s\n' '407049cb91f1d09592900e817d126e87f35dcd1533af3e8276ae62bfeb40595f' \ | |
| '/app/resources/model-pricing/model_prices_and_context_window.json' | sha256sum -c - | |
| COPY start.sh /app/start.sh | |
| RUN chmod +x /app/start.sh && \ | |
| chown -R app:app /app && \ | |
| rm -rf /tmp/payload | |
| WORKDIR /app | |
| EXPOSE 8080 | |
| ENTRYPOINT ["/app/start.sh"] | |