-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.web
More file actions
35 lines (30 loc) · 1.53 KB
/
Copy pathDockerfile.web
File metadata and controls
35 lines (30 loc) · 1.53 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
FROM node:22-alpine AS deps
WORKDIR /app
COPY apps/web/package.json apps/web/package-lock.json* ./
RUN npm ci --prefer-offline
# ── Build Next.js ────────────────────────────────────────────────────────────
FROM node:22-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY apps/web/ .
COPY version.json /version.json
ENV DEPLOY_MODE=docker
RUN npm run build
# ── Production image ─────────────────────────────────────────────────────────
FROM node:22-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
# Copy compiled Next.js output and everything needed by server.ts
COPY --from=deps /app/node_modules ./node_modules
COPY --from=builder /app/.next ./.next
COPY apps/web/server.ts ./server.ts
COPY apps/web/package.json ./package.json
COPY apps/web/tsconfig.json ./tsconfig.json
EXPOSE 3200
ENV WEB_PORT=3200
ENV HOSTNAME=0.0.0.0
# tsx executes server.ts directly — handles both Next.js requests and WebSocket.
# Output is tee'd into /app/logs/web.log so the in-app /logs viewer (which
# tails the file) works inside docker too. The worker_logs volume is shared
# with the worker container so both logs are visible from one place.
CMD ["sh", "-c", "mkdir -p /app/logs && npx tsx server.ts 2>&1 | tee -a /app/logs/web.log"]