-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile.frontend
More file actions
31 lines (24 loc) · 893 Bytes
/
Dockerfile.frontend
File metadata and controls
31 lines (24 loc) · 893 Bytes
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
# Build frontend for Cloudflare Pages deployment
FROM node:22-slim
WORKDIR /app
# `cascade.managed=true` is the contract the router's dangling-image cleanup
# loop filters on (src/router/dangling-image-cleanup.ts). Without this LABEL,
# the loop matches zero images and reclaims nothing — see PR #1256.
LABEL cascade.managed=true
# Install backend deps (needed for type imports from src/api)
COPY package*.json .npmrc ./
RUN npm ci --ignore-scripts
# Install frontend deps
COPY web/package*.json web/
RUN cd web && npm ci
# Copy source (backend types + frontend)
COPY tsconfig.json ./
COPY src ./src
COPY web ./web
# Build with API URL baked in
ARG VITE_API_URL
ENV VITE_API_URL=$VITE_API_URL
RUN cd web && npm run build
# Install wrangler for deployment
RUN npm install -g wrangler
CMD ["wrangler", "pages", "deploy", "dist/web", "--project-name=cascade-dashboard", "--branch=main"]