Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: apply best practices for the latest buildkit (#5527)

kurokoboea29007bc0bb
diff --git a/api/Dockerfile b/api/Dockerfile
index 15fd9d88e08..4f0e7f65e3f 100644
--- a/api/Dockerfile
+++ b/api/Dockerfile
@@ -1,5 +1,5 @@
# base image
-FROM python:3.10-slim-bookworm as base
+FROM python:3.10-slim-bookworm AS base
WORKDIR /app/api
@@ -14,7 +14,7 @@ ENV POETRY_NO_INTERACTION=1
ENV POETRY_VIRTUALENVS_IN_PROJECT=true
ENV POETRY_VIRTUALENVS_CREATE=true
-FROM base as packages
+FROM base AS packages
RUN apt-get update \
&& apt-get install -y --no-install-recommends gcc g++ libc-dev libffi-dev libgmp-dev libmpfr-dev libmpc-dev
@@ -27,18 +27,18 @@ RUN poetry install --sync --no-cache --no-root
# production stage
FROM base AS production
-ENV FLASK_APP app.py
-ENV EDITION SELF_HOSTED
-ENV DEPLOY_ENV PRODUCTION
-ENV CONSOLE_API_URL http://127.0.0.1:5001
-ENV CONSOLE_WEB_URL http://127.0.0.1:3000
-ENV SERVICE_API_URL http://127.0.0.1:5001
-ENV APP_WEB_URL http://127.0.0.1:3000
+ENV FLASK_APP=app.py
+ENV EDITION=SELF_HOSTED
+ENV DEPLOY_ENV=PRODUCTION
+ENV CONSOLE_API_URL=http://127.0.0.1:5001
+ENV CONSOLE_WEB_URL=http://127.0.0.1:3000
+ENV SERVICE_API_URL=http://127.0.0.1:5001
+ENV APP_WEB_URL=http://127.0.0.1:3000
EXPOSE 5001
# set timezone
-ENV TZ UTC
+ENV TZ=UTC
WORKDIR /app/api
@@ -61,6 +61,6 @@ RUN chmod +x /entrypoint.sh
ARG COMMIT_SHA
-ENV COMMIT_SHA ${COMMIT_SHA}
+ENV COMMIT_SHA=${COMMIT_SHA}
ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]
diff --git a/web/Dockerfile b/web/Dockerfile
index f2fc4af2f81..56957f09270 100644
--- a/web/Dockerfile
+++ b/web/Dockerfile
@@ -9,7 +9,7 @@ RUN apk add --no-cache tzdata
# install packages
-FROM base as packages
+FROM base AS packages
WORKDIR /app/web
@@ -22,7 +22,7 @@ COPY yarn.lock .
RUN yarn install --frozen-lockfile
# build resources
-FROM base as builder
+FROM base AS builder
WORKDIR /app/web
COPY --from=packages /app/web/ .
COPY . .
@@ -31,17 +31,17 @@ RUN yarn build
# production stage
-FROM base as production
+FROM base AS production
-ENV NODE_ENV production
-ENV EDITION SELF_HOSTED
-ENV DEPLOY_ENV PRODUCTION
-ENV CONSOLE_API_URL http://127.0.0.1:5001
-ENV APP_API_URL http://127.0.0.1:5001
-ENV PORT 3000
+ENV NODE_ENV=production
+ENV EDITION=SELF_HOSTED
+ENV DEPLOY_ENV=PRODUCTION
+ENV CONSOLE_API_URL=http://127.0.0.1:5001
+ENV APP_API_URL=http://127.0.0.1:5001
+ENV PORT=3000
# set timezone
-ENV TZ UTC
+ENV TZ=UTC
RUN ln -s /usr/share/zoneinfo/${TZ} /etc/localtime \
&& echo ${TZ} > /etc/timezone
@@ -59,7 +59,7 @@ COPY docker/pm2.json ./pm2.json
COPY docker/entrypoint.sh ./entrypoint.sh
ARG COMMIT_SHA
-ENV COMMIT_SHA ${COMMIT_SHA}
+ENV COMMIT_SHA=${COMMIT_SHA}
EXPOSE 3000
ENTRYPOINT ["/bin/sh", "./entrypoint.sh"]