-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile.iframe-outputs
More file actions
48 lines (36 loc) · 1.45 KB
/
Dockerfile.iframe-outputs
File metadata and controls
48 lines (36 loc) · 1.45 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
# syntax=docker/dockerfile:1.4
# Build stage
FROM node:23-alpine AS builder
RUN npm install -g pnpm@latest
WORKDIR /app
# Copy workspace files
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
# Copy workspace package.json files (needed for pnpm workspace resolution)
COPY packages/schema/package.json packages/schema/tsconfig.json ./packages/schema/
COPY packages/components/package.json packages/components/tsconfig.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 iframe
COPY packages/schema/src ./packages/schema/src
COPY src/components/ui ./src/components/ui
COPY src/lib ./src/lib
COPY src/util/iframe.ts ./src/util/iframe.ts
COPY packages/components ./packages/components
COPY iframe-outputs ./iframe-outputs
COPY vite.config.ts tsconfig.json tsconfig.node.json ./
# Build the components package first (required for iframe-outputs)
RUN pnpm --filter @runtimed/components build
# Build the iframe outputs
RUN pnpm build:iframe
# Production stage
FROM nginx:alpine
# Copy built files from builder stage
COPY --from=builder /app/iframe-outputs/worker/dist /usr/share/nginx/html
# Copy nginx configuration
COPY iframe-outputs/nginx-main.conf /etc/nginx/nginx.conf
COPY iframe-outputs/nginx.conf /etc/nginx/conf.d/default.conf
# Expose port 8000
EXPOSE 8000
# Start nginx
CMD ["nginx", "-g", "daemon off;"]