Hemasagar commited on
Commit
eacae98
·
verified ·
1 Parent(s): 75a5b18

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -16
Dockerfile CHANGED
@@ -1,25 +1,29 @@
1
- # read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
- # you will also find guides on how best to write your Dockerfile
3
-
4
- FROM python:3.9
5
-
6
- RUN useradd -m -u 1000 user
7
 
8
  WORKDIR /app
9
 
10
- COPY --chown=user ./requirements.txt requirements.txt
11
-
12
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
13
-
14
- COPY --chown=user . /app
15
 
16
- CMD ["streamlit", "run", "app.py"]
 
17
 
18
- # RUN pip3 install -r requirements.txt
 
 
 
 
19
 
20
- # EXPOSE 8501
 
 
 
21
 
22
- # HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
23
 
24
- # ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
25
 
 
 
 
 
 
 
 
1
+ FROM python:3.10
 
 
 
 
 
2
 
3
  WORKDIR /app
4
 
5
+ COPY ./requirements.txt /app/requirements.txt
6
+ COPY ./packages.txt /app/packages.txt
 
 
 
7
 
8
+ RUN apt-get update && xargs -r -a /app/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
9
+ RUN pip3 install --no-cache-dir -r /app/requirements.txt
10
 
11
+ # User
12
+ RUN useradd -m -u 1001 user
13
+ USER user
14
+ ENV HOME /home/user
15
+ ENV PATH $HOME/.local/bin:$PATH
16
 
17
+ WORKDIR $HOME
18
+ RUN mkdir app
19
+ WORKDIR $HOME/app
20
+ COPY . $HOME/app
21
 
 
22
 
 
23
 
24
+ EXPOSE 8502
25
+ CMD streamlit run app.py \
26
+ --server.headless true \
27
+ --server.enableCORS false \
28
+ --server.enableXsrfProtection false \
29
+ --server.fileWatcherType none