CodeQL Advanced / Analyze (actions) (push) Canceled after 0s
CodeQL Advanced / Analyze (java-kotlin) (push) Canceled after 0s
CodeQL Advanced / Analyze (javascript-typescript) (push) Canceled after 0s
CodeQL Advanced / Analyze (python) (push) Canceled after 0s
Docker Image Build & Push / manifest (push) Canceled after 0s
Docker Image Build & Push / manifest (push) Canceled after 0s
Docker Image Build & Push / manifest (push) Canceled after 0s
Docker Image Build & Push / build-and-push-arm (push) Canceled after 0s
Docker Image Build & Push / build-and-push-amd (push) Canceled after 0s
Docker Image Build & Push / build-and-push-arm (push) Canceled after 0s
Docker Image Build & Push / build-and-push-amd (push) Canceled after 0s
Docker Image Build & Push / build-and-push-arm (push) Canceled after 0s
Docker Image Build & Push / build-and-push-amd (push) Canceled after 0s
Deer Flow Docker Image CI / build-and-push-amd (push) Canceled after 0s
Deer Flow Docker Image CI / build-and-push-arm (push) Canceled after 0s
Deer Flow Docker Image CI / manifest (push) Canceled after 0s
Docker Image Build & Push / manifest (push) Canceled after 0s
Docker Image Build & Push / build-and-push-arm (push) Canceled after 0s
Docker Image Build & Push / build-and-push-amd (push) Canceled after 0s
Docker Image Build & Push / manifest (push) Canceled after 0s
Docker Image Build & Push / build-and-push-arm (push) Canceled after 0s
Docker Image Build & Push / build-and-push-amd (push) Canceled after 0s
Docker Image Build & Push / manifest (push) Canceled after 0s
Docker Image Build & Push / build-and-push-arm (push) Canceled after 0s
Docker Image Build & Push / build-and-push-amd (push) Canceled after 0s
Docker Image Build & Push / manifest (push) Canceled after 0s
Docker Image Build & Push / build-and-push-arm (push) Canceled after 0s
Docker Image Build & Push / build-and-push-amd (push) Canceled after 0s
Python Backend Docker Image CI / Build and Push Backend Python Docker Image (push) Canceled after 0s
Backend Docker Image CI / Build and Push Backend Docker Image (push) Canceled after 0s
Database Docker Image CI / Build and Push Database Docker Image (push) Canceled after 0s
Frontend Docker Image CI / Build and Push Frontend Docker Image (push) Canceled after 0s
Gateway Docker Image CI / Build and Push Gateway Docker Image (push) Canceled after 0s
Label Studio Docker Image CI / Build and Push Label Studio Docker Image (push) Canceled after 0s
Runtime Docker Image CI / Build and Push Runtime Docker Image (push) Canceled after 0s
67 lines
1.7 KiB
Docker
67 lines
1.7 KiB
Docker
##### DEPENDENCIES
|
|
|
|
FROM node:20-alpine AS deps
|
|
RUN apk add --no-cache libc6-compat openssl
|
|
WORKDIR /app
|
|
|
|
# 原git拉取逻辑注释,改用本地COPY,本地上下文目录存在 deepflow 文件夹
|
|
# && mv /deepflow/web/* /app \
|
|
# && rm -rf /deepflow
|
|
|
|
# 将本地 deepflow/web 下全部内容复制到镜像 /app
|
|
COPY deepflow/web/ ./
|
|
|
|
# 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="/deepflow-backend"
|
|
|
|
# 原git拉取逻辑注释
|
|
# RUN cd /deepflow \
|
|
# && mv /deepflow/web/* /app \
|
|
# && rm -rf /deepflow
|
|
|
|
# 本地复制web目录源码
|
|
COPY deepflow/web/ ./
|
|
|
|
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 node:20-alpine 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"]
|