-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathDockerfile.ui
More file actions
64 lines (49 loc) · 2.53 KB
/
Copy pathDockerfile.ui
File metadata and controls
64 lines (49 loc) · 2.53 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
54
55
56
57
58
59
60
61
62
63
64
# Stage 1: Build frontend assets
FROM node:24.14-slim AS builder
WORKDIR /app
# Copy dependency files first for better Docker layer caching
COPY ./skyvern-frontend/package.json ./skyvern-frontend/package-lock.json ./
# --include=dev keeps tsc/vite installed even if NODE_ENV=production is inherited
# from the host/build env (npm omits devDependencies otherwise -> "tsc: not found").
RUN npm ci --include=dev
# Copy source code
COPY ./skyvern-frontend/ ./
# Placeholders for runtime injection (replaced by entrypoint script at container start).
# Every VITE_* variable that the frontend reads via import.meta.env must have a
# placeholder here so Vite bakes the placeholder string into the JS bundle,
# allowing sed replacement at container start.
ENV VITE_API_BASE_URL=__VITE_API_BASE_URL_PLACEHOLDER__
ENV VITE_WSS_BASE_URL=__VITE_WSS_BASE_URL_PLACEHOLDER__
ENV VITE_ARTIFACT_API_BASE_URL=__VITE_ARTIFACT_API_BASE_URL_PLACEHOLDER__
ENV VITE_SKYVERN_API_KEY=__SKYVERN_API_KEY_PLACEHOLDER__
ENV VITE_BROWSER_STREAMING_MODE=__VITE_BROWSER_STREAMING_MODE_PLACEHOLDER__
ENV VITE_ENABLE_LOG_ARTIFACTS=__VITE_ENABLE_LOG_ARTIFACTS_PLACEHOLDER__
ENV VITE_ENABLE_CODE_BLOCK=__VITE_ENABLE_CODE_BLOCK_PLACEHOLDER__
ENV VITE_ENABLE_2FA_NOTIFICATIONS=__VITE_ENABLE_2FA_NOTIFICATIONS_PLACEHOLDER__
# APP_VERSION is baked into the JS bundle at build time via Vite's define.
# Pass --build-arg APP_VERSION=$(git rev-parse HEAD) when building the image.
ARG APP_VERSION=development
ENV APP_VERSION=$APP_VERSION
# Vite's rollup phase needs more than V8's default ~2GB heap.
ENV NODE_OPTIONS=--max-old-space-size=4096
# Build assets at image build time (with placeholder values baked in)
RUN npm run build
# Stage 2: Runtime image (only built assets + servers)
FROM node:24.14-slim
# Install tini for proper signal handling and zombie reaping
RUN apt-get update && apt-get install -y --no-install-recommends tini && rm -rf /var/lib/apt/lists/*
WORKDIR /app
# dist is a pristine template; the entrypoint re-creates /app/dist from it
# on every start so env-var changes apply on `docker restart`.
COPY --from=builder /app/dist ./dist.template
COPY --from=builder /app/localServer.js ./
COPY --from=builder /app/artifactServer.js ./
COPY --from=builder /app/package.json ./
COPY --from=builder /app/package-lock.json ./
# Install only production dependencies needed for the servers
RUN npm ci --omit=dev
COPY ./entrypoint-skyvernui.sh ./entrypoint-skyvernui.sh
RUN chmod +x ./entrypoint-skyvernui.sh
EXPOSE 8080 9090
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["/bin/bash", "./entrypoint-skyvernui.sh"]