forked from jgarzik/botmaker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (36 loc) · 1.06 KB
/
Dockerfile
File metadata and controls
51 lines (36 loc) · 1.06 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
# Build stage
FROM node:20-slim AS builder
WORKDIR /app
# Install build dependencies for native modules (better-sqlite3)
RUN apt-get update && apt-get install -y python3 make g++ && rm -rf /var/lib/apt/lists/*
# Copy package files
COPY package*.json ./
COPY dashboard/package*.json ./dashboard/
# Install dependencies
RUN npm ci
RUN cd dashboard && npm ci
# Copy source
COPY . .
# Build
RUN npm run build
RUN cd dashboard && npm run build
# Production stage
FROM node:20-slim
WORKDIR /app
# Install build dependencies for native modules (better-sqlite3) and debugging tools
RUN apt-get update && apt-get install -y python3 make g++ curl && rm -rf /var/lib/apt/lists/*
# Install only production dependencies
COPY package*.json ./
RUN npm ci --omit=dev
# Copy built files
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/dashboard/dist ./dashboard/dist
# Create data directories
RUN mkdir -p /app/data /app/secrets
# Environment
ENV NODE_ENV=production
ENV PORT=7100
ENV DATA_DIR=/app/data
ENV SECRETS_DIR=/app/secrets
EXPOSE 7100
CMD ["node", "dist/index.js"]