Anthony Truchet commited on
Commit
d7d6b2f
·
1 Parent(s): ec78e7f

fix: IP syntaxt in toml

Browse files
Files changed (2) hide show
  1. .streamlit/config.toml +0 -3
  2. Dockerfile +16 -11
.streamlit/config.toml CHANGED
@@ -8,8 +8,5 @@ font="sans serif"
8
  [server]
9
  maxUploadSize = 200
10
  headless = true
11
- enableCORS = false
12
- enableXsrfProtection = false
13
- fileWatcherType = none
14
  address = "0.0.0.0"
15
  port = 8501
 
8
  [server]
9
  maxUploadSize = 200
10
  headless = true
 
 
 
11
  address = "0.0.0.0"
12
  port = 8501
Dockerfile CHANGED
@@ -13,26 +13,31 @@ RUN pip3 install --no-cache-dir -r /app/requirements.txt
13
  RUN useradd -m -u 1000 user
14
  # Copy our code to /app taking car of the permissions
15
  COPY --chown=root:user --chmod=g+rXs src/ /app/
16
- # Copy the config file for streamlit
17
- RUN mkdir -p /app/.streamlit
18
- COPY .streamlit /app/.streamlit
19
 
20
  # Persistent disk space
 
 
 
21
  # see https://huggingface.co/docs/hub/spaces-storage
22
- RUN mkdir -p /data/.huggingface
23
- ENV HF_HOME /data/.huggingface
24
- RUN chown user /data/.huggingface
 
25
 
26
  # User
27
  USER user
28
  ENV HOME /home/user
29
  ENV PATH $HOME/.local/bin:$PATH
30
 
31
- WORKDIR /app/
32
-
33
-
34
 
35
  # Expose streamlit application
36
  EXPOSE 8501
37
- CMD streamlit run athai/app.py \
38
-
 
 
 
 
13
  RUN useradd -m -u 1000 user
14
  # Copy our code to /app taking car of the permissions
15
  COPY --chown=root:user --chmod=g+rXs src/ /app/
16
+ # Prepare the config directory for streamlit
17
+ RUN mkdir -p /app/.streamlit && chown user:user /app/.streamlit
 
18
 
19
  # Persistent disk space
20
+ # Assumes a mount is passed to the docker command, like:
21
+ # $ docker ... --mount type=volume,src=ai-playground-vol,dst=/data ...
22
+ #
23
  # see https://huggingface.co/docs/hub/spaces-storage
24
+ RUN mkdir -p /data/huggingface
25
+ RUN mkdir -p /data/app
26
+ RUN chown user:user /data/* && chmod ug+rwXs /data
27
+ ENV HF_HOME /data/huggingface
28
 
29
  # User
30
  USER user
31
  ENV HOME /home/user
32
  ENV PATH $HOME/.local/bin:$PATH
33
 
34
+ # Copy the configuration of strealit toward the end to leverage caching
35
+ COPY .streamlit /app/.streamlit
 
36
 
37
  # Expose streamlit application
38
  EXPOSE 8501
39
+ CMD streamlit run athai/app.py \
40
+ --logger.level=debug \
41
+ --server.enableXsrfProtection=true \
42
+ --server.fileWatcherType=none
43
+