-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (33 loc) · 1.21 KB
/
Dockerfile
File metadata and controls
42 lines (33 loc) · 1.21 KB
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
# G0DM0D3 Research Preview API
# Deploy on Hugging Face Spaces (Docker SDK) or any container host.
#
# Build: docker build -t g0dm0d3-api .
# Run: docker run -p 7860:7860 \
# -e OPENROUTER_API_KEY=sk-or-... \
# -e GODMODE_API_KEY=your-secret-key \
# g0dm0d3-api
#
# OPENROUTER_API_KEY: Your OpenRouter key (powers all model calls)
# GODMODE_API_KEY: Auth key callers must send as Bearer token
# HF_TOKEN: HuggingFace write token for auto-publishing data
# HF_DATASET_REPO: Target HF dataset repo (e.g. LYS10S/g0dm0d3-research)
FROM node:20-slim
WORKDIR /app
# Copy package files and install deps
COPY package.json package-lock.json* ./
RUN npm ci --omit=dev 2>/dev/null || npm install --omit=dev
# Copy source (api + engine libs)
COPY api/ ./api/
COPY src/lib/ ./src/lib/
COPY src/stm/ ./src/stm/
# Create non-root user for security
RUN addgroup --system app && adduser --system --ingroup app app
# HF Spaces expects port 7860
ENV PORT=7860
EXPOSE 7860
# Switch to non-root user
USER app
# Health check for container orchestrators
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s \
CMD curl -f http://localhost:7860/v1/health || exit 1
CMD ["npx", "tsx", "api/server.ts"]