# Runtime image from host-built Next standalone (branding rebuild) ARG NODE_VERSION=24.22.1 FROM node:${NODE_VERSION}-alpine AS production ENV NODE_ENV=production 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 MARKETPLACE_API_URL=https://marketplace.dify.ai ENV MARKETPLACE_URL=https://marketplace.dify.ai ENV PORT=3000 ENV EXPERIMENTAL_ENABLE_VINEXT=false ENV NEXT_TELEMETRY_DISABLED=1 ENV TZ=UTC RUN ln -s /usr/share/zoneinfo/${TZ} /etc/localtime && echo ${TZ} > /etc/timezone ARG dify_uid=1001 RUN addgroup -S -g ${dify_uid} dify && \ adduser -S -u ${dify_uid} -G dify -s /bin/ash -h /home/dify dify && \ mkdir /app && chown -R dify:dify /app WORKDIR /app COPY --chown=dify:dify .next/standalone ./targets/next/ COPY --chown=dify:dify public ./targets/next/web/public COPY --chown=dify:dify .next/static ./targets/next/web/.next/static # keep vinext slot present but unused (entrypoint only uses it when enabled) RUN mkdir -p ./targets/vinext && chown -R dify:dify ./targets COPY --chown=dify:dify --chmod=755 docker/entrypoint.sh ./entrypoint.sh USER dify EXPOSE 3000 ENTRYPOINT ["/bin/sh", "./entrypoint.sh"]