Mahinour1 commited on
Commit
289c44a
·
1 Parent(s): bb105cf

add config file

Browse files
Files changed (3) hide show
  1. .chainlit/config.yaml +9 -0
  2. Dockerfile +6 -2
  3. app.py +2 -0
.chainlit/config.yaml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ chainlit_server:
2
+ host: 0.0.0.0
3
+ port: 7860
4
+ headless: true
5
+
6
+ # Project settings
7
+ project:
8
+ # Force HTTP mode
9
+ enable_websocket: false
Dockerfile CHANGED
@@ -59,9 +59,11 @@ RUN mkdir -p /home/user/app/.files && \
59
  RUN chown -R user:user /home/user && \
60
  chmod -R 755 /home/user/app
61
 
62
- RUN pip install pydantic==2.10.1 chainlit
63
 
64
  COPY chainlit.md .
 
 
65
 
66
 
67
  # Expose port
@@ -71,6 +73,8 @@ EXPOSE 7860
71
  USER user
72
 
73
  # Run the application
74
- CMD ["chainlit", "run", "app.py", "--host", "0.0.0.0", "--port", "7860", "--no-cache"]
 
 
75
 
76
  # CMD ["chainlit", "run", "app.py", "--host", "0.0.0.0", "--port", "7860"]
 
59
  RUN chown -R user:user /home/user && \
60
  chmod -R 755 /home/user/app
61
 
62
+ # RUN pip install pydantic==2.10.1 chainlit
63
 
64
  COPY chainlit.md .
65
+ COPY .chainlit/config.yaml /home/user/app/.chainlit/config.yaml
66
+
67
 
68
 
69
  # Expose port
 
73
  USER user
74
 
75
  # Run the application
76
+ # CMD ["chainlit", "run", "app.py", "--host", "0.0.0.0", "--port", "7860", "--no-cache"]
77
+ CMD ["chainlit", "run", "app.py", "--host", "0.0.0.0", "--port", "7860", "--headless"]
78
+
79
 
80
  # CMD ["chainlit", "run", "app.py", "--host", "0.0.0.0", "--port", "7860"]
app.py CHANGED
@@ -4,6 +4,8 @@ os.environ["CHAINLIT_DISABLE_WEBSOCKETS"] = "true"
4
  # Also consider setting these for HF Spaces
5
  os.environ["CHAINLIT_SERVER_PORT"] = "7860"
6
  os.environ["CHAINLIT_SERVER_HOST"] = "0.0.0.0"
 
 
7
  import getpass
8
  from operator import itemgetter
9
  from typing import List, Dict
 
4
  # Also consider setting these for HF Spaces
5
  os.environ["CHAINLIT_SERVER_PORT"] = "7860"
6
  os.environ["CHAINLIT_SERVER_HOST"] = "0.0.0.0"
7
+ os.environ["CHAINLIT_USE_PREDEFINED_HOST_PORT"] = "true"
8
+ os.environ["CHAINLIT_USE_HTTP"] = "true"
9
  import getpass
10
  from operator import itemgetter
11
  from typing import List, Dict