sikeaditya commited on
Commit
8022f95
·
verified ·
1 Parent(s): bbd1dd6

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -14
Dockerfile CHANGED
@@ -2,20 +2,26 @@ FROM python:3.9-slim
2
 
3
  WORKDIR /app
4
 
5
- # Copy and install requirements
6
- COPY requirements.txt /app/requirements.txt
7
- RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
 
 
 
8
 
9
- # Set up a new non-root user
10
- RUN useradd -m -u 1000 user
11
- USER user
12
- ENV HOME=/home/user
13
- ENV PATH=/home/user/.local/bin:$PATH
14
 
15
- # Create a cache directory and set environment variable
16
- RUN mkdir -p /home/user/.cache && chown -R user:user /home/user/.cache
17
- ENV HF_HOME=/home/user/.cache
18
 
19
- # Set working directory to the user's app directory
20
- WORKDIR $HOME/app
21
- COPY --chown=user . $HOME/app
 
 
 
 
 
 
 
2
 
3
  WORKDIR /app
4
 
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ build-essential \
8
+ curl \
9
+ software-properties-common \
10
+ && rm -rf /var/lib/apt/lists/*
11
 
12
+ # Copy requirements and install Python dependencies
13
+ COPY requirements.txt .
14
+ RUN pip install -r requirements.txt
 
 
15
 
16
+ # Copy the app
17
+ COPY . .
 
18
 
19
+ # Expose port 7860 for Streamlit
20
+ EXPOSE 7860
21
+
22
+ # Set environment variables
23
+ ENV LC_ALL=C.UTF-8
24
+ ENV LANG=C.UTF-8
25
+
26
+ # Command to run the Streamlit app
27
+ CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]