You've already forked DataMate
@@ -1,4 +1,4 @@
|
||||
FROM maven:3-openjdk-8-slim AS datax-builder
|
||||
FROM maven:3-eclipse-temurin-8 AS datax-builder
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y git && \
|
||||
@@ -11,7 +11,7 @@ RUN cd DataX && \
|
||||
plugin-rdbms-util/src/main/java/com/alibaba/datax/plugin/rdbms/util/DataBaseType.java && \
|
||||
mvn -U clean package assembly:assembly -Dmaven.test.skip=true
|
||||
|
||||
FROM maven:3-amazoncorretto-21-debian AS builder
|
||||
FROM maven:3-eclipse-temurin-21 AS builder
|
||||
|
||||
COPY backend/ /opt/backend
|
||||
|
||||
@@ -19,7 +19,7 @@ RUN cd /opt/backend && \
|
||||
mvn -U clean package -Dmaven.test.skip=true
|
||||
|
||||
|
||||
FROM openjdk:21-jdk-slim
|
||||
FROM eclipse-temurin:21-jdk
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y vim wget curl nfs-common rsync python3 python3-pip python-is-python3 dos2unix && \
|
||||
@@ -29,8 +29,6 @@ RUN apt-get update && \
|
||||
COPY --from=builder /opt/backend/services/main-application/target/data-mate.jar /opt/backend/data-mate.jar
|
||||
COPY --from=datax-builder /DataX/target/datax/datax /opt/datax
|
||||
|
||||
COPY editions/community/config/application.yml /opt/backend/application.yml
|
||||
COPY editions/community/config/log4j2.xml /opt/backend/log4j2.xml
|
||||
COPY scripts/images/backend/start.sh /opt/backend/start.sh
|
||||
|
||||
RUN dos2unix /opt/backend/start.sh \
|
||||
|
||||
32
scripts/images/deer-flow-backend/Dockerfile
Normal file
32
scripts/images/deer-flow-backend/Dockerfile
Normal file
@@ -0,0 +1,32 @@
|
||||
FROM ghcr.io/astral-sh/uv:python3.12-bookworm
|
||||
|
||||
# Install uv.
|
||||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
|
||||
|
||||
# Install system dependencies including libpq
|
||||
RUN apt-get update && apt-get install -y \
|
||||
libpq-dev git \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the application into the container.
|
||||
RUN git clone https://github.com/bytedance/deer-flow.git /app
|
||||
COPY runtime/deer-flow/feature_collection.patch /app/feature_collection.patch
|
||||
COPY runtime/deer-flow/.env /app/.env
|
||||
COPY runtime/deer-flow/conf.yaml /app/conf.yaml
|
||||
|
||||
RUN git apply feature_collection.patch
|
||||
|
||||
# Pre-cache the application dependencies.
|
||||
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||
uv sync --locked --no-install-project
|
||||
|
||||
# Install the application dependencies.
|
||||
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||
uv sync --locked
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
# Run the application.
|
||||
CMD ["uv", "run", "python", "server.py", "--host", "0.0.0.0", "--port", "8000"]
|
||||
65
scripts/images/deer-flow-frontend/Dockerfile
Normal file
65
scripts/images/deer-flow-frontend/Dockerfile
Normal file
@@ -0,0 +1,65 @@
|
||||
##### DEPENDENCIES
|
||||
|
||||
FROM node:20-alpine AS deps
|
||||
RUN apk add --no-cache libc6-compat openssl git
|
||||
WORKDIR /app
|
||||
|
||||
RUN git clone https://github.com/bytedance/deer-flow.git /deer-flow \
|
||||
&& mv /deer-flow/web/* /app \
|
||||
&& rm -rf /deer-flow
|
||||
# Install dependencies based on the preferred package manager
|
||||
|
||||
RUN if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
|
||||
elif [ -f package-lock.json ]; then npm ci; \
|
||||
elif [ -f pnpm-lock.yaml ]; then npm install -g pnpm && pnpm i; \
|
||||
else echo "Lockfile not found." && exit 1; \
|
||||
fi
|
||||
|
||||
##### BUILDER
|
||||
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
RUN apk add --no-cache git
|
||||
|
||||
WORKDIR /app
|
||||
ARG NEXT_PUBLIC_API_URL="/deer-flow-backend"
|
||||
|
||||
RUN git clone https://github.com/bytedance/deer-flow.git /deer-flow
|
||||
|
||||
COPY runtime/deer-flow/feature_collection.patch /deer-flow/feature_collection.patch
|
||||
|
||||
RUN cd /deer-flow \
|
||||
&& git apply feature_collection.patch \
|
||||
&& mv /deer-flow/web/* /app \
|
||||
&& rm -rf /deer-flow
|
||||
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
RUN if [ -f yarn.lock ]; then SKIP_ENV_VALIDATION=1 yarn build; \
|
||||
elif [ -f package-lock.json ]; then SKIP_ENV_VALIDATION=1 npm run build; \
|
||||
elif [ -f pnpm-lock.yaml ]; then npm install -g pnpm && SKIP_ENV_VALIDATION=1 pnpm run build; \
|
||||
else echo "Lockfile not found." && exit 1; \
|
||||
fi
|
||||
|
||||
##### RUNNER
|
||||
|
||||
FROM gcr.io/distroless/nodejs20-debian12 AS runner
|
||||
WORKDIR /app
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
COPY --from=builder /app/next.config.js ./
|
||||
COPY --from=builder /app/public ./public
|
||||
COPY --from=builder /app/package.json ./package.json
|
||||
|
||||
COPY --from=builder /app/.next/standalone ./
|
||||
COPY --from=builder /app/.next/static ./.next/static
|
||||
|
||||
EXPOSE 3000
|
||||
ENV PORT=3000
|
||||
|
||||
CMD ["server.js"]
|
||||
@@ -8,7 +8,7 @@ COPY scripts/images/runtime/start.sh /opt/runtime/start.sh
|
||||
ENV PYTHONPATH=/opt/runtime/datamate/
|
||||
|
||||
RUN apt update \
|
||||
&& apt install -y libgl1 libglib2.0-0 vim libmagic1t64 libreoffice\
|
||||
&& apt install -y libgl1 libglib2.0-0 vim libmagic1t64 libreoffice dos2unix \
|
||||
&& apt clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
@@ -19,7 +19,8 @@ RUN pip install -e . --trusted-host mirrors.huaweicloud.com -i https://mirrors.h
|
||||
&& pip cache purge
|
||||
|
||||
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
||||
&& chmod +x /opt/runtime/start.sh
|
||||
&& chmod +x /opt/runtime/start.sh \
|
||||
&& dos2unix /opt/runtime/start.sh
|
||||
|
||||
EXPOSE 8081
|
||||
|
||||
|
||||
Reference in New Issue
Block a user