From 67fa99c64a9c0551fa58e77c827418a34590dbc5 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Mon, 28 Sep 2026 16:33:18 +0200 Subject: [PATCH] Added dockerfile to partner ui --- PostFundManagement.PartnerUI/Dockerfile | 41 +++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 PostFundManagement.PartnerUI/Dockerfile diff --git a/PostFundManagement.PartnerUI/Dockerfile b/PostFundManagement.PartnerUI/Dockerfile new file mode 100644 index 0000000..d3e040a --- /dev/null +++ b/PostFundManagement.PartnerUI/Dockerfile @@ -0,0 +1,41 @@ +# Stage 1: Build stage +FROM node:20-alpine AS builder + +WORKDIR /app + +# Enable corepack to use Yarn +RUN corepack enable + +# Copy dependency definitions from the UI subdirectory into the container's /app folder +COPY PostFundManagement.PartnerUI/package*.json PostFundManagement.PartnerUI/yarn.lock* ./ + +# Install dependencies via Yarn +RUN yarn install --frozen-lockfile || yarn install + +# Copy application source from the UI subdirectory into the container's /app folder +COPY PostFundManagement.PartnerUI/ ./ + +# Build Vite application for production +RUN yarn build + +# Stage 2: Production Nginx Server +FROM nginx:alpine + +WORKDIR /usr/share/nginx/html + +# Copy nginx configuration from stage 1 build directory +COPY --from=builder /app/nginx.conf /etc/nginx/conf.d/default.conf + +# Copy compiled static assets from build stage +COPY --from=builder /app/dist ./ + +# Copy entrypoint script for dynamic runtime environment variables +COPY --from=builder /app/docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod +x /docker-entrypoint.sh + +# Expose port 3000 +EXPOSE 3000 + +# Set entrypoint and default command +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["nginx", "-g", "daemon off;"]