-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (25 loc) · 1.09 KB
/
Copy pathDockerfile
File metadata and controls
36 lines (25 loc) · 1.09 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
# ─── Build stage ──────────────────────────────────────────────────────────────
FROM node:20-alpine AS base
# Install curl for healthcheck
RUN apk add --no-cache curl
WORKDIR /app
# Copy package files first (better layer caching)
COPY package*.json ./
# Install production dependencies only
RUN npm ci --omit=dev
# ─── App stage ────────────────────────────────────────────────────────────────
FROM base AS app
WORKDIR /app
# Copy source code
COPY src/ ./src/
COPY config/ ./config/
COPY scripts/ ./scripts/
# Create data directory for local database
RUN mkdir -p /app/data
# Expose REST API port
EXPOSE 3000
# Health check — hits the CrustAI REST API
HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
CMD curl -f http://localhost:3000/health || exit 1
# Start CrustAI
CMD ["node", "src/core/index.js"]