github-actions[bot] commited on
Commit
b1d6098
·
0 Parent(s):

deploy-storage: ef32eba4 - 2026-07-09 13:49 UTC

Browse files
Files changed (5) hide show
  1. Dockerfile +20 -0
  2. LAST_COMMIT_DATE.txt +1 -0
  3. README.md +12 -0
  4. SOURCE_COMMIT_SHA.txt +1 -0
  5. start.sh +45 -0
Dockerfile ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM node:20-alpine
2
+
3
+ WORKDIR /bootstrap
4
+
5
+ RUN apk add --no-cache bash git ca-certificates openssh-client python3 py3-pip sqlite
6
+
7
+ ENV NODE_ENV=production
8
+ ENV NODE_OPTIONS="--max-old-space-size=8092"
9
+ ENV PORT=7860
10
+ ENV UV_THREADPOOL_SIZE=4
11
+
12
+ COPY start.sh /bootstrap/start.sh
13
+ RUN chmod +x /bootstrap/start.sh
14
+
15
+ EXPOSE 7860
16
+
17
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
18
+ CMD node -e "const http=require('http'); const req=http.get({host:'127.0.0.1',port:process.env.PORT||7860,path:'/health',timeout:5000},(res)=>process.exit(res.statusCode===200?0:1)); req.on('error',()=>process.exit(1)); req.on('timeout',()=>{req.destroy();process.exit(1)});"
19
+
20
+ CMD ["/bootstrap/start.sh"]
LAST_COMMIT_DATE.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ 2026-07-09T16:49:50+03:00
README.md ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Pulltime Storage Service
3
+ emoji: 💾
4
+ colorFrom: indigo
5
+ colorTo: blue
6
+ sdk: docker
7
+ app_port: 7860
8
+ pinned: false
9
+ ---
10
+
11
+ Bootstrap runtime for Pulltime Storage Service.
12
+ Source code is fetched from private GitHub at container startup.
SOURCE_COMMIT_SHA.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ ef32eba4e5e1155dd45607e7335b5e1f9dd5bf3c
start.sh ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ if [ -z "${GH_REPO_TOKEN:-}" ]; then
5
+ echo "GH_REPO_TOKEN secret missing. Configure it in Hugging Face Space Settings -> Variables and secrets." >&2
6
+ exit 1
7
+ fi
8
+
9
+ REPO_SLUG="${GH_REPO_SLUG:-shs3131/pulltime}"
10
+ REPO_REF="${GH_REPO_REF:-main}"
11
+ APP_SUBDIR="${GH_APP_SUBDIR:-server/storage-service}"
12
+ APP_DIR="/runtime/app"
13
+
14
+ mkdir -p /runtime
15
+ rm -rf "$APP_DIR"
16
+
17
+ git clone --depth 1 --branch "$REPO_REF" "https://x-access-token:${GH_REPO_TOKEN}@github.com/${REPO_SLUG}.git" "$APP_DIR"
18
+
19
+ # Resolve app directory safely even if GH_APP_SUBDIR is misconfigured.
20
+ APP_SUBDIR="${APP_SUBDIR#/}"
21
+ RESOLVED_SUBDIR=""
22
+
23
+ for candidate in "$APP_SUBDIR" "server/storage-service" "storage-service"; do
24
+ if [ -f "$APP_DIR/$candidate/package.json" ]; then
25
+ RESOLVED_SUBDIR="$candidate"
26
+ break
27
+ fi
28
+ done
29
+
30
+ if [ -z "$RESOLVED_SUBDIR" ]; then
31
+ echo "package.json not found. Checked: $APP_SUBDIR, server/storage-service, storage-service" >&2
32
+ exit 1
33
+ fi
34
+
35
+ cd "$APP_DIR/$RESOLVED_SUBDIR"
36
+ echo "Using app subdir: $RESOLVED_SUBDIR"
37
+
38
+ if [ -f package-lock.json ] || [ -f npm-shrinkwrap.json ]; then
39
+ npm ci --omit=dev
40
+ else
41
+ echo "Lockfile not found, falling back to npm install --omit=dev"
42
+ npm install --omit=dev
43
+ fi
44
+
45
+ exec npm start