Files
sim/docker/realtime.Dockerfile
Waleed 923595f57e fix(webhooks): use next public app url instead of request origin for webhook registration (#1596)
* fix(webhooks): use next public app url instead of request origin for webhook registration

* ack PR comments

* ci: pin Bun to v1.2.22 to avoid Bun 1.3 breaking changes
2025-10-10 17:19:51 -07:00

52 lines
1.4 KiB
Docker

# ========================================
# Base Stage: Alpine Linux with Bun
# ========================================
FROM oven/bun:1.2.22-alpine AS base
# ========================================
# Dependencies Stage: Install Dependencies
# ========================================
FROM base AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app
# Install turbo globally
RUN bun install -g turbo
COPY package.json bun.lock ./
RUN mkdir -p apps
COPY apps/sim/package.json ./apps/sim/package.json
RUN bun install --omit dev --ignore-scripts
# ========================================
# Builder Stage: Build the Application
# ========================================
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
# ========================================
# Runner Stage: Run the Socket Server
# ========================================
FROM base AS runner
WORKDIR /app
ENV NODE_ENV=production
# Copy the sim app and the shared db package needed by socket-server
COPY --from=builder /app/apps/sim ./apps/sim
COPY --from=builder /app/packages/db ./packages/db
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
# Expose socket server port (default 3002, but configurable via PORT env var)
EXPOSE 3002
ENV PORT=3002 \
SOCKET_PORT=3002 \
HOSTNAME="0.0.0.0"
# Run the socket server directly
CMD ["bun", "apps/sim/socket-server/index.ts"]