forked from vfarcic/dot-ai
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
49 lines (36 loc) · 1.5 KB
/
Dockerfile.dev
File metadata and controls
49 lines (36 loc) · 1.5 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
# Multi-stage build for development - builds from local source
# Build stage - creates the same package that would be published to npm
FROM node:22@sha256:22ab967fdf8d9ce32387d0c06ab2e32c6793d860bb93ccce6e27927ccdfeee6d AS builder
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install all dependencies (including dev dependencies for building)
RUN npm ci
# Copy source code
COPY . .
# Build the project (same as npm publish preparation)
RUN npm run build
# Production stage - mirror of production Dockerfile but install local package
FROM node:22@sha256:22ab967fdf8d9ce32387d0c06ab2e32c6793d860bb93ccce6e27927ccdfeee6d AS production
# Install kubectl (same as production needs)
RUN apt-get update && \
apt-get install -y curl && \
ARCH=$(dpkg --print-architecture) && \
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/${ARCH}/kubectl" && \
chmod +x kubectl && \
mv kubectl /usr/local/bin/ && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Copy the complete built package from builder stage (everything npm would publish)
COPY --from=builder /app ./package
# Install the local package globally (same as production Dockerfile but from local)
RUN npm install -g ./package
# Set working directory
WORKDIR /app
# Create sessions directory
RUN mkdir -p /app/sessions
# Set default environment variables
ENV DOT_AI_SESSION_DIR=/app/sessions
ENV NODE_ENV=production
# Default command to run dot-ai-mcp (same as production)
CMD ["dot-ai-mcp"]