ktejeshnaidu commited on
Commit
3fe3f75
·
verified ·
1 Parent(s): e8be885

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -22
Dockerfile CHANGED
@@ -1,30 +1,22 @@
1
  FROM python:3.12-slim
2
 
3
- # Install system dependencies
4
- RUN apt-get update && apt-get install -y gcc g++ libc-dev
5
-
6
- # Hugging Face Spaces require applications to run as a non-root user
7
- RUN useradd -m -u 1000 user
8
- USER user
9
-
10
- # Set up environment variables
11
- ENV HOME=/home/user \
12
- PATH=/home/user/.local/bin:$PATH
13
 
14
- WORKDIR $HOME/app
 
 
 
 
15
 
16
- # Copy requirements and install
17
- COPY --chown=user requirements.txt .
18
- RUN pip install --no-cache-dir --default-timeout=1000 -r requirements.txt
19
 
20
  # Copy application files
21
- COPY --chown=user . .
22
-
23
- # Make start script executable
24
- RUN chmod +x run.sh
25
 
26
- # Expose Streamlit port
27
- EXPOSE 8501
28
 
29
- # Boot both API and UI using the shell script
30
- CMD ["./run.sh"]
 
1
  FROM python:3.12-slim
2
 
3
+ WORKDIR /app
 
 
 
 
 
 
 
 
 
4
 
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ build-essential \
8
+ curl \
9
+ && rm -rf /var/lib/apt/lists/*
10
 
11
+ # Copy requirements and install Python dependencies
12
+ COPY requirements.txt .
13
+ RUN pip install --no-cache-dir -r requirements.txt
14
 
15
  # Copy application files
16
+ COPY . .
 
 
 
17
 
18
+ # Expose ports
19
+ EXPOSE 8501 8000
20
 
21
+ # Run Streamlit app
22
+ CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]