mazen2100 commited on
Commit
cb3dcae
·
verified ·
1 Parent(s): 9a1b69b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -7
Dockerfile CHANGED
@@ -1,22 +1,25 @@
1
- # Base image
2
  FROM python:3.9-slim
3
 
4
- # Set working directory
5
  WORKDIR /app
6
 
7
- # Set environment variables for Streamlit and Hugging Face
8
  ENV STREAMLIT_HOME=/app/.streamlit
9
  ENV TRANSFORMERS_CACHE=/app/.cache/huggingface/hub
10
 
11
- # Install dependencies
 
 
 
12
  COPY requirements.txt .
13
  RUN pip install --no-cache-dir -r requirements.txt
14
 
15
- # Copy the app code
16
  COPY . .
17
 
18
- # Expose Streamlit port
19
  EXPOSE 8501
20
 
21
- # Run the app
22
  CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
1
+ # Use a Python image as the base image
2
  FROM python:3.9-slim
3
 
4
+ # Set working directory inside the container
5
  WORKDIR /app
6
 
7
+ # Set environment variables to specify where to store the cache and Streamlit configuration
8
  ENV STREAMLIT_HOME=/app/.streamlit
9
  ENV TRANSFORMERS_CACHE=/app/.cache/huggingface/hub
10
 
11
+ # Create directories for Streamlit and Hugging Face cache to ensure they're writable
12
+ RUN mkdir -p /app/.streamlit /app/.cache/huggingface/hub
13
+
14
+ # Install dependencies from requirements.txt
15
  COPY requirements.txt .
16
  RUN pip install --no-cache-dir -r requirements.txt
17
 
18
+ # Copy the rest of your application files into the container
19
  COPY . .
20
 
21
+ # Expose the port Streamlit will run on
22
  EXPOSE 8501
23
 
24
+ # Command to run the app
25
  CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]