leonsimon23 commited on
Commit
33ff25f
·
verified ·
1 Parent(s): 7170ae8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -3
Dockerfile CHANGED
@@ -7,8 +7,14 @@ WORKDIR /app
7
  # 复制 requirements.txt 到容器中
8
  COPY requirements.txt .
9
 
10
- # 安装依赖
11
- RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
 
 
12
 
13
  # 复制项目的所有文件到容器中
14
  COPY . .
@@ -21,6 +27,9 @@ RUN mkdir -p /app/public && \
21
  chmod -R 777 /app/.files && \
22
  chmod -R 777 /app/public
23
 
 
 
 
24
  # 生成随机secret并创建环境变量文件
25
  RUN python -c "import secrets; print('CHAINLIT_AUTH_SECRET=\"' + secrets.token_hex(32) + '\"')" > .env && \
26
  echo "FASTGPT_BASE_URL=\"${FASTGPT_BASE_URL}\"" >> .env && \
@@ -39,4 +48,4 @@ USER chainlit
39
  EXPOSE 8000
40
 
41
  # 启动 Chainlit 应用程序
42
- CMD ["chainlit", "run", "app.py", "--host", "0.0.0.0", "--port", "8000"]
 
7
  # 复制 requirements.txt 到容器中
8
  COPY requirements.txt .
9
 
10
+ # 安装系统依赖和Python依赖
11
+ RUN apt-get update && \
12
+ apt-get install -y --no-install-recommends gcc python3-dev && \
13
+ pip install --no-cache-dir -r requirements.txt && \
14
+ apt-get remove -y gcc python3-dev && \
15
+ apt-get autoremove -y && \
16
+ apt-get clean && \
17
+ rm -rf /var/lib/apt/lists/*
18
 
19
  # 复制项目的所有文件到容器中
20
  COPY . .
 
27
  chmod -R 777 /app/.files && \
28
  chmod -R 777 /app/public
29
 
30
+ # 创建默认的配置文件
31
+ RUN echo 'enable_telemetry: false\n\ndefault_expand_messages: true\npdf:\n max_size_mb: 25' > /app/.chainlit/config.toml
32
+
33
  # 生成随机secret并创建环境变量文件
34
  RUN python -c "import secrets; print('CHAINLIT_AUTH_SECRET=\"' + secrets.token_hex(32) + '\"')" > .env && \
35
  echo "FASTGPT_BASE_URL=\"${FASTGPT_BASE_URL}\"" >> .env && \
 
48
  EXPOSE 8000
49
 
50
  # 启动 Chainlit 应用程序
51
+ CMD ["chainlit", "run", "--host", "0.0.0.0", "--port", "8000", "app.py"]