yixian56 commited on
Commit
53f7836
·
verified ·
1 Parent(s): 0ed41e8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -43
Dockerfile CHANGED
@@ -2,43 +2,9 @@ FROM langgenius/dify-web:1.4.1
2
 
3
  USER root
4
 
5
- # 创建entrypoint.sh脚本(使用常规方式而不是heredoc)
6
- RUN echo '#!/bin/bash' > /app/entrypoint.sh && \
7
- echo '' >> /app/entrypoint.sh && \
8
- echo '# if you are using windows, you may need to convert the file to unix format' >> /app/entrypoint.sh && \
9
- echo '# you can use the Ubuntu terminal to convert this file to unix format' >> /app/entrypoint.sh && \
10
- echo '# otherwise, you may get the error after running the docker container' >> /app/entrypoint.sh && \
11
- echo '' >> /app/entrypoint.sh && \
12
- echo '# sudo apt-get install dos2unix' >> /app/entrypoint.sh && \
13
- echo '# dos2unix entrypoint.sh' >> /app/entrypoint.sh && \
14
- echo '' >> /app/entrypoint.sh && \
15
- echo 'set -e' >> /app/entrypoint.sh && \
16
- echo '' >> /app/entrypoint.sh && \
17
- echo 'export NEXT_PUBLIC_DEPLOY_ENV=${DEPLOY_ENV}' >> /app/entrypoint.sh && \
18
- echo 'export NEXT_PUBLIC_EDITION=${EDITION}' >> /app/entrypoint.sh && \
19
- echo 'export NEXT_PUBLIC_API_PREFIX=${CONSOLE_API_URL}/console/api' >> /app/entrypoint.sh && \
20
- echo 'export NEXT_PUBLIC_PUBLIC_API_PREFIX=${APP_API_URL}/api' >> /app/entrypoint.sh && \
21
- echo 'export NEXT_PUBLIC_MARKETPLACE_API_PREFIX=${MARKETPLACE_API_URL}/api/v1' >> /app/entrypoint.sh && \
22
- echo 'export NEXT_PUBLIC_MARKETPLACE_URL_PREFIX=${MARKETPLACE_URL}' >> /app/entrypoint.sh && \
23
- echo '' >> /app/entrypoint.sh && \
24
- echo 'export NEXT_PUBLIC_SENTRY_DSN=${SENTRY_DSN}' >> /app/entrypoint.sh && \
25
- echo 'export NEXT_PUBLIC_SITE_ABOUT=${SITE_ABOUT}' >> /app/entrypoint.sh && \
26
- echo 'export NEXT_TELEMETRY_DISABLED=${NEXT_TELEMETRY_DISABLED}' >> /app/entrypoint.sh && \
27
- echo '' >> /app/entrypoint.sh && \
28
- echo 'export NEXT_PUBLIC_TEXT_GENERATION_TIMEOUT_MS=${TEXT_GENERATION_TIMEOUT_MS}' >> /app/entrypoint.sh && \
29
- echo 'export NEXT_PUBLIC_CSP_WHITELIST=${CSP_WHITELIST}' >> /app/entrypoint.sh && \
30
- echo 'export NEXT_PUBLIC_ALLOW_EMBED=${ALLOW_EMBED}' >> /app/entrypoint.sh && \
31
- echo 'export NEXT_PUBLIC_TOP_K_MAX_VALUE=${TOP_K_MAX_VALUE}' >> /app/entrypoint.sh && \
32
- echo 'export NEXT_PUBLIC_INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH=${INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH}' >> /app/entrypoint.sh && \
33
- echo 'export NEXT_PUBLIC_MAX_TOOLS_NUM=${MAX_TOOLS_NUM}' >> /app/entrypoint.sh && \
34
- echo 'export NEXT_PUBLIC_ENABLE_WEBSITE_JINAREADER=${ENABLE_WEBSITE_JINAREADER:-true}' >> /app/entrypoint.sh && \
35
- echo 'export NEXT_PUBLIC_ENABLE_WEBSITE_FIRECRAWL=${ENABLE_WEBSITE_FIRECRAWL:-true}' >> /app/entrypoint.sh && \
36
- echo 'export NEXT_PUBLIC_ENABLE_WEBSITE_WATERCRAWL=${ENABLE_WEBSITE_WATERCRAWL:-true}' >> /app/entrypoint.sh && \
37
- echo 'export NEXT_PUBLIC_LOOP_NODE_MAX_COUNT=${LOOP_NODE_MAX_COUNT}' >> /app/entrypoint.sh && \
38
- echo 'export NEXT_PUBLIC_MAX_PARALLEL_LIMIT=${MAX_PARALLEL_LIMIT}' >> /app/entrypoint.sh && \
39
- echo 'export NEXT_PUBLIC_MAX_ITERATIONS_NUM=${MAX_ITERATIONS_NUM}' >> /app/entrypoint.sh && \
40
- echo 'pm2 start /app/web/server.js --name dify-web --cwd /app/web -i ${PM2_INSTANCES} --no-daemon' >> /app/entrypoint.sh && \
41
- chmod +x /app/entrypoint.sh
42
 
43
  # 配置环境变量
44
  ENV NEXT_TELEMETRY_DISABLED=0 \
@@ -57,11 +23,6 @@ ENV NEXT_TELEMETRY_DISABLED=0 \
57
  CONSOLE_API_URL=https://yixian56-dify-api.hf.space \
58
  APP_API_URL=https://yixian56-dify-api.hf.space
59
 
60
- # 工作目录
61
- WORKDIR /app
62
-
63
- # 暴露Web端口
64
  EXPOSE 3000
65
 
66
- # 设置入口点
67
- ENTRYPOINT ["/app/entrypoint.sh"]
 
2
 
3
  USER root
4
 
5
+ # 复制外部脚本文件到镜像
6
+ COPY entrypoint.sh /usr/local/bin/
7
+ RUN chmod +x /usr/local/bin/entrypoint.sh
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
  # 配置环境变量
10
  ENV NEXT_TELEMETRY_DISABLED=0 \
 
23
  CONSOLE_API_URL=https://yixian56-dify-api.hf.space \
24
  APP_API_URL=https://yixian56-dify-api.hf.space
25
 
 
 
 
 
26
  EXPOSE 3000
27
 
28
+ ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]