-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
53 lines (41 loc) · 1.36 KB
/
Dockerfile
File metadata and controls
53 lines (41 loc) · 1.36 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
43
44
45
46
47
48
49
50
51
52
53
# Bounty-bot Service - Dockerfile
# GitHub bounty validation service, controlled by Atlas via REST API
FROM node:22-slim
# Install system dependencies for better-sqlite3 native module and health checks
RUN apt-get update && apt-get install -y \
python3 \
make \
g++ \
sqlite3 \
curl \
git \
ripgrep \
&& rm -rf /var/lib/apt/lists/*
# Create app directory
WORKDIR /app
# Copy package files first for better Docker layer caching
COPY package*.json ./
# Install dependencies with native build flags
RUN npm ci --unsafe-perm || npm install --unsafe-perm
# Copy TypeScript config, source, and rules
COPY tsconfig.json ./
COPY src/ ./src/
COPY rules/ ./rules/
# Build TypeScript
RUN npm run build
# Compile rules to JS (they live outside src/ and aren't covered by tsc)
# esbuild strips type-only imports and produces clean ESM .js files
RUN for f in rules/code/*.ts rules/llm/*.ts; do \
[ -f "$f" ] && npx esbuild "$f" --outdir="$(dirname "$f")" --format=esm --platform=node 2>/dev/null && rm "$f" || true; \
done
# Create required directories
RUN mkdir -p /app/data
# Environment defaults
ENV NODE_ENV=production
ENV PORT=3235
ENV DATA_DIR=/app/data
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:3235/health || exit 1
# Run the service
CMD ["node", "dist/index.js"]