Nechba commited on
Commit
57ac871
·
verified ·
1 Parent(s): a780a2e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -7
Dockerfile CHANGED
@@ -2,22 +2,34 @@
2
  FROM python:3.9
3
 
4
  # Set the working directory
5
- WORKDIR /code
6
 
7
  # Install system dependencies
8
  RUN apt-get update && apt-get install -y glpk-utils
9
 
10
  # Copy only requirements.txt initially to leverage Docker cache
11
- COPY requirements.txt /code/requirements.txt
12
 
13
  # Install Python dependencies
14
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
15
 
16
  # Copy the rest of the application code
17
  COPY . /code
18
 
19
- # Expose the port Streamlit runs on (default is 8501)
20
- EXPOSE 7860
 
 
 
21
 
22
- # Command to run your Streamlit application
23
- CMD ["streamlit", "run", "app.py"]
 
 
 
 
 
 
 
 
 
 
2
  FROM python:3.9
3
 
4
  # Set the working directory
5
+ WORKDIR /app
6
 
7
  # Install system dependencies
8
  RUN apt-get update && apt-get install -y glpk-utils
9
 
10
  # Copy only requirements.txt initially to leverage Docker cache
11
+ COPY requirements.txt /app/requirements.txt
12
 
13
  # Install Python dependencies
14
+ RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
15
 
16
  # Copy the rest of the application code
17
  COPY . /code
18
 
19
+ # User
20
+ RUN useradd -m -u 1000 user
21
+ USER user
22
+ ENV HOME /home/user
23
+ ENV PATH $HOME/.local/bin:$PATH
24
 
25
+ WORKDIR $HOME
26
+ RUN mkdir app
27
+ WORKDIR $HOME/app
28
+ COPY . $HOME/app
29
+
30
+ EXPOSE 8501
31
+ CMD streamlit run app.py \
32
+ --server.headless true \
33
+ --server.enableCORS false \
34
+ --server.enableXsrfProtection false \
35
+ --server.fileWatcherType none