-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile.web
More file actions
53 lines (41 loc) · 1.63 KB
/
Dockerfile.web
File metadata and controls
53 lines (41 loc) · 1.63 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# syntax=docker/dockerfile:1.4
# Build stage
FROM node:23-alpine AS builder
RUN apk add --no-cache bash git && corepack enable && corepack prepare pnpm@latest --activate
WORKDIR /app
# Copy workspace files
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
# Copy package.json files for all packages
COPY packages/agent-core/package.json ./packages/agent-core/
COPY packages/ai-core/package.json ./packages/ai-core/
COPY packages/pyodide-runtime/package.json ./packages/pyodide-runtime/
COPY packages/schema/package.json ./packages/schema/
COPY packages/components/package.json ./packages/components/
# Install dependencies with cache mount
RUN --mount=type=cache,id=pnpm-store,target=/root/.local/share/pnpm/store \
pnpm install --frozen-lockfile
# Copy source files needed for build
COPY packages ./packages
COPY src ./src
COPY public ./public
COPY vite.config.ts tsconfig.json tsconfig.node.json ./
COPY index.html ./
COPY vite-plugins ./vite-plugins
# Set git commit hash to avoid git commands in container
ENV VITE_GIT_COMMIT_HASH=docker-build
ENV VITE_API_TARGET=http://sync:8787
# Build the web app
RUN pnpm build
# Production stage
FROM nginx:alpine
# Copy built files from builder stage
COPY --from=builder /app/dist /usr/share/nginx/html
# Copy nginx configuration
COPY nginx-main.conf /etc/nginx/nginx.conf
# Copy as template - nginx:alpine automatically processes templates in /etc/nginx/templates/
COPY nginx.conf /etc/nginx/templates/default.conf.template
# Set default SYNC_HOST (can be overridden at runtime)
ENV SYNC_HOST=sync
# Expose port 5173
EXPOSE 5173
# nginx:alpine entrypoint automatically processes templates and starts nginx