mirror of
https://github.com/crabwise-ai/crabwalk.git
synced 2026-08-14 00:57:52 +00:00
- parse ALLOWED_HOSTS into vite server.allowedHosts for LAN/tailscale access - copy src/, public/, vite.config.ts, tsconfig.json into Docker runtime stage (dev server needs these, only dist/ was copied before) - pass ALLOWED_HOSTS through docker-compose Ref #10
35 lines
771 B
Docker
35 lines
771 B
Docker
# Build stage
|
|
FROM node:22-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package*.json ./
|
|
RUN npm ci
|
|
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
# Runtime stage
|
|
FROM node:22-alpine AS runner
|
|
|
|
WORKDIR /app
|
|
|
|
# NOTE: TanStack Start server entry produced by `vite build` does not bind a port
|
|
# on its own in this repo, so we run the Vite dev server in Docker for now.
|
|
# This makes the published image functional while we figure out a proper prod server.
|
|
|
|
ENV NODE_ENV=development
|
|
|
|
COPY package*.json ./
|
|
RUN npm ci
|
|
|
|
COPY --from=builder /app/dist ./dist
|
|
COPY --from=builder /app/src ./src
|
|
COPY --from=builder /app/public ./public
|
|
COPY --from=builder /app/vite.config.ts ./
|
|
COPY --from=builder /app/tsconfig.json ./
|
|
|
|
EXPOSE 3000
|
|
|
|
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0", "--port", "3000"]
|