-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (27 loc) · 880 Bytes
/
Dockerfile
File metadata and controls
38 lines (27 loc) · 880 Bytes
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
# Stage 1: Build frontend with Vite
FROM node:20-alpine AS builder
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npm run build
# Stage 2: Production server
FROM node:20-alpine
WORKDIR /app
ENV NODE_ENV=production
# Install production dependencies (including native modules like better-sqlite3)
COPY package.json package-lock.json ./
RUN npm ci --omit=dev
# Copy built frontend
COPY --from=builder /app/dist ./dist
# Copy backend source files
COPY server.js auth.js platforms.js scheduler.js engagement-engine.js ai-media.js db.js ./
COPY video/ ./video/
# Create data directories
RUN mkdir -p uploads output data
# Expose port
EXPOSE 3001
# Health check
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:3001/api/health || exit 1
CMD ["node", "server.js"]