- docker-compose.dev.yml: hot-reload dev stack (rete-watch + server :7357 + web :5173) - docker-compose.yml: production stack - packages/chess/Dockerfile + nginx.conf: chess web image - packages/server/Dockerfile: server image - Dockerfile.dev: shared dev base image (Bun + workspace deps preinstalled) - .dockerignore: build context exclusions Used by Playwright e2e tests (run via .sisyphus/scripts/run-pw.sh which connects to the running dev stack instead of spawning its own server).
36 lines
1.1 KiB
Docker
36 lines
1.1 KiB
Docker
# syntax=docker/dockerfile:1.7
|
|
# Vite-built React SPA for @paratype/chess, served by nginx.
|
|
# Build context: monorepo root.
|
|
|
|
FROM oven/bun:1.3 AS deps
|
|
WORKDIR /app
|
|
|
|
COPY package.json bun.lock ./
|
|
COPY tsconfig.base.json tsconfig.json ./
|
|
COPY packages/rete/package.json packages/rete/
|
|
COPY packages/chess/package.json packages/chess/
|
|
COPY packages/server/package.json packages/server/
|
|
|
|
RUN bun install --frozen-lockfile
|
|
|
|
# ---- builder
|
|
FROM deps AS builder
|
|
# rete must be built first — chess imports it via the "import" export
|
|
# which points at dist/index.js.
|
|
COPY packages/rete packages/rete
|
|
RUN bun run --filter @paratype/rete build
|
|
|
|
COPY packages/chess packages/chess
|
|
|
|
# Bake the WebSocket URL into the bundle. Override at build time with
|
|
# --build-arg VITE_WS_URL=wss://your-host/ws
|
|
ARG VITE_WS_URL=ws://localhost:7357/ws
|
|
ENV VITE_WS_URL=$VITE_WS_URL
|
|
|
|
RUN bun run --filter @paratype/chess build
|
|
|
|
# ---- runtime
|
|
FROM nginx:1.27-alpine AS runtime
|
|
COPY --from=builder /app/packages/chess/dist /usr/share/nginx/html
|
|
COPY packages/chess/nginx.conf /etc/nginx/conf.d/default.conf
|
|
EXPOSE 80
|