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.

support setting timezone in docker images (#2091)

Bowen Liang9ad7b65996d7
diff --git a/api/Dockerfile b/api/Dockerfile
index 4df40c2f548..aec0d47cfcb 100644
--- a/api/Dockerfile
+++ b/api/Dockerfile
@@ -13,6 +13,7 @@ RUN pip install --prefix=/pkg -r requirements.txt
# build stage
FROM python:3.10-slim AS builder
+
ENV FLASK_APP app.py
ENV EDITION SELF_HOSTED
ENV DEPLOY_ENV PRODUCTION
@@ -23,6 +24,11 @@ ENV APP_WEB_URL http://127.0.0.1:3000
EXPOSE 5001
+# set timezone
+ENV TZ UTC
+RUN ln -s /usr/share/zoneinfo/${TZ} /etc/localtime \
+ && echo ${TZ} > /etc/timezone
+
WORKDIR /app/api
RUN apt-get update \
diff --git a/web/Dockerfile b/web/Dockerfile
index 1c2ba6bc2e3..3634ecf92d8 100644
--- a/web/Dockerfile
+++ b/web/Dockerfile
@@ -2,6 +2,9 @@
FROM node:20.11.0-alpine AS base
LABEL maintainer="[email protected]"
+RUN apk add --no-cache tzdata
+
+
# install packages
FROM base as packages
@@ -32,6 +35,10 @@ 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
+RUN ln -s /usr/share/zoneinfo/${TZ} /etc/localtime \
+ && echo ${TZ} > /etc/timezone
WORKDIR /app/web
COPY --from=builder /app/web/public ./public