From 1101727d1ed0552c470748f29eeff9d3961eb0ef Mon Sep 17 00:00:00 2001 From: Mahaboob Pasha Date: Sun, 15 Jun 2025 22:36:06 +0530 Subject: [PATCH 1/2] Added UI Docker integration --- docker-compose.yml | 16 ++++++++++- ee/ui-component/Dockerfile | 49 +++++++++++++++++++++++++++++++++ ee/ui-component/next.config.mjs | 1 + 3 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 ee/ui-component/Dockerfile diff --git a/docker-compose.yml b/docker-compose.yml index ef69ff57..e6a8d1a2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,6 +13,20 @@ services: - ./morphik.toml:/morphik.toml <<: *ollama-check + ui: + build: + context: ./ee/ui-component + dockerfile: Dockerfile + ports: + - "3000:3000" + environment: + - NEXT_PUBLIC_API_URL=http://morphik:8000 + depends_on: + morphik: + condition: service_started + networks: + - morphik-network + morphik: build: . ports: @@ -104,7 +118,7 @@ services: - POSTGRES_DB=morphik - PGDATA=/var/lib/postgresql/data/pgdata ports: - - "5432:5432" + - "5433:5432" volumes: - postgres_data:/var/lib/postgresql/data healthcheck: diff --git a/ee/ui-component/Dockerfile b/ee/ui-component/Dockerfile new file mode 100644 index 00000000..fcc6f017 --- /dev/null +++ b/ee/ui-component/Dockerfile @@ -0,0 +1,49 @@ +# syntax=docker/dockerfile:1 + +# Build stage +FROM node:23.11.0-alpine AS builder + + +# Set working directory +WORKDIR /app + +# Copy package files +COPY package*.json ./ +COPY tsconfig*.json ./ +COPY next.config.mjs ./ +COPY postcss.config.mjs ./ +COPY tailwind.config.ts ./ + +# Install dependencies +RUN npm install + +# Copy source code +COPY . . + +# Print Node.js version for debugging +RUN node --version && npm --version + + +# Build the application +RUN npm run build + +# Production stage +FROM node:23.11.0-alpine AS production + +WORKDIR /app + +# Set environment variables +ENV NODE_ENV=production +ENV NEXT_TELEMETRY_DISABLED=1 + +# Copy necessary files from builder +COPY --from=builder /app/next.config.mjs ./ +COPY --from=builder /app/public ./public +COPY --from=builder /app/.next/standalone ./ +COPY --from=builder /app/.next/static ./.next/static + +# Expose port +EXPOSE 3000 + +# Set the command to run the application +CMD ["node", "server.js"] \ No newline at end of file diff --git a/ee/ui-component/next.config.mjs b/ee/ui-component/next.config.mjs index 23a43c0e..258afcd6 100644 --- a/ee/ui-component/next.config.mjs +++ b/ee/ui-component/next.config.mjs @@ -1,5 +1,6 @@ /** @type {import('next').NextConfig} */ const nextConfig = { + output: 'standalone', webpack: (config) => { config.resolve.alias.canvas = false; return config; From c1fc07c38b0cf6b63c3a2dc600400dcbeba14cff Mon Sep 17 00:00:00 2001 From: Mahaboob Pasha Date: Sun, 15 Jun 2025 22:36:47 +0530 Subject: [PATCH 2/2] Added UI Docker integration --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index e6a8d1a2..c0798d3f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -118,7 +118,7 @@ services: - POSTGRES_DB=morphik - PGDATA=/var/lib/postgresql/data/pgdata ports: - - "5433:5432" + - "5432:5432" volumes: - postgres_data:/var/lib/postgresql/data healthcheck: