Files
Manan Bhatt f052420f16 fix(docker): update ui-builder stage to use ui-next instead of legacy ui
PR #1168 switched publish.yml to build ui-next (pnpm/Vite) and embed
it in the server JAR, but the Dockerfile still referenced the old
ui/build path. The COPY --from=ui-builder step failed because ui/build
is never produced when PREBUILT=true.

- Change ui-builder to COPY ui-next and run pnpm build (non-prebuilt)
- Change final COPY to use /conductor/ui-next/dist instead of /conductor/ui/build
- Allowlist ui-next/dist in .dockerignore (was excluded by **/dist)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 12:11:15 +05:30

87 lines
2.9 KiB
Docker

#
# conductor:server - Conductor Server + UI
#
# Two modes:
# Default: Builds JAR and UI from source (docker-compose, local dev)
# PREBUILT=true: Skips builds, uses pre-built artifacts (CI multi-arch)
#
# ===========================================================================================================
# 0. Builder stage
# ===========================================================================================================
FROM azul/zulu-openjdk-debian:21 AS builder
ARG PREBUILT=false
ARG INDEXING_BACKEND=elasticsearch
LABEL maintainer="Orkes OSS <oss@orkes.io>"
COPY . /conductor
WORKDIR /conductor
RUN if [ "$PREBUILT" = "true" ]; then \
rm -rf server/build/libs && mkdir -p server/build/libs && \
cp docker/server/libs/conductor-server.jar server/build/libs/conductor-server-boot.jar && \
echo "Using pre-built server JAR"; \
else \
./gradlew build -x test -x spotlessCheck -x shadowJar \
-PindexingBackend=${INDEXING_BACKEND} \
-Dorg.gradle.jvmargs=-Xmx2g \
--no-daemon --no-parallel; \
fi
# ===========================================================================================================
# 1. UI builder stage
# ===========================================================================================================
FROM node:lts AS ui-builder
ARG PREBUILT=false
LABEL maintainer="Orkes OSS <oss@orkes.io>"
COPY ui-next /conductor/ui-next
WORKDIR /conductor/ui-next
RUN if [ "$PREBUILT" = "false" ]; then \
corepack enable && \
pnpm install && \
NODE_OPTIONS=--max-old-space-size=4096 pnpm build; \
else \
echo "Using pre-built UI assets"; \
fi
# ===========================================================================================================
# 2. Final stage
# ===========================================================================================================
FROM debian:stable-slim
LABEL maintainer="Orkes OSS <oss@orkes.io>"
RUN apt-get update \
&& apt-get install -y --no-install-recommends openjdk-21-jre-headless nginx curl ca-certificates \
&& rm -f /etc/nginx/sites-enabled/default \
&& rm -rf /var/lib/apt/lists/*
# Make app folders
RUN mkdir -p /app/config /app/logs /app/libs
# Copy the compiled output to new image
COPY docker/server/bin /app
COPY docker/server/config /app/config
COPY --from=builder /conductor/server/build/libs/*boot*.jar /app/libs/conductor-server.jar
# Copy compiled UI assets to nginx www directory
WORKDIR /usr/share/nginx/html
RUN rm -rf ./*
COPY --from=ui-builder /conductor/ui-next/dist .
COPY docker/server/nginx/nginx.conf /etc/nginx/conf.d/default.conf
# Copy the files for the server into the app folders
RUN chmod +x /app/startup.sh
HEALTHCHECK --interval=60s --timeout=30s --retries=10 CMD curl -I -XGET http://localhost:8080/health || exit 1
CMD [ "/app/startup.sh" ]
ENTRYPOINT [ "/bin/sh"]