Files
crabwalk/Dockerfile
T
luccast ff6fed5932 support ALLOWED_HOSTS env var, fix Dockerfile missing source files
- 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
2026-01-28 09:00:42 -05:00

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"]