-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (36 loc) · 1.67 KB
/
Dockerfile
File metadata and controls
50 lines (36 loc) · 1.67 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
# TradeClaw — Multi-stage Production Dockerfile
# ── Stage 1: builder ──────────────────────────────────────────────────────────
FROM node:22-alpine AS builder
WORKDIR /app
# Install dependencies
COPY package.json package-lock.json ./
COPY apps/web/package.json ./apps/web/
COPY packages/core/package.json ./packages/core/
COPY packages/signals/package.json ./packages/signals/
RUN npm ci
# Copy source
COPY . .
# Build (standalone output enabled in next.config.ts)
ENV NEXT_TELEMETRY_DISABLED=1
RUN npm run build
# Verify standalone was generated
RUN ls /app/apps/web/.next/standalone/apps/web/server.js
# Copy static assets into standalone
RUN cp -r /app/apps/web/public /app/apps/web/.next/standalone/apps/web/public && \
cp -r /app/apps/web/.next/static /app/apps/web/.next/standalone/apps/web/.next/static
# ── Stage 2: production ───────────────────────────────────────────────────────
FROM node:22-alpine AS production
# Install curl for healthcheck
RUN apk add --no-cache curl
WORKDIR /app
# Copy standalone output from builder (includes node_modules at root)
COPY --from=builder /app/apps/web/.next/standalone ./
# Entrypoint handles --help and env-var wiring before launching the server.
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
ENV HOSTNAME=0.0.0.0
EXPOSE 3000
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD []