-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
55 lines (37 loc) · 1.15 KB
/
Dockerfile
File metadata and controls
55 lines (37 loc) · 1.15 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
54
55
# Reflexive Hosted Mode Dockerfile
# Optimized for Railway, Render, and other container platforms
FROM node:22-slim AS builder
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install all dependencies (including dev for build)
RUN npm ci
# Copy source code
COPY . .
# Build TypeScript
RUN npm run build
# Production stage
FROM node:22-slim
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install production dependencies only
RUN npm ci --omit=dev
# Copy built files
COPY --from=builder /app/dist ./dist
# Copy static assets
COPY logo-carbon.png ./
# Create non-root user for security
RUN useradd --create-home --shell /bin/bash reflexive && \
chown -R reflexive:reflexive /app
USER reflexive
# Expose default port (Railway will override with $PORT)
EXPOSE 3099
# Environment variables
ENV NODE_ENV=production
ENV PORT=3099
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD node -e "require('http').get('http://localhost:' + (process.env.PORT || 3099) + '/api/health', res => { process.exit(res.statusCode === 200 ? 0 : 1) })"
# Start hosted mode server
CMD ["node", "dist/cli.js", "--sandbox"]