AAnvar commited on
Commit
126a0fb
·
verified ·
1 Parent(s): 6b1921d

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -22
Dockerfile CHANGED
@@ -1,29 +1,20 @@
1
- # Use the official Python base image
2
- FROM python:3.11-slim
3
 
4
- # Set environment variables
5
- ENV PYTHONDONTWRITEBYTECODE=1
6
- ENV PYTHONUNBUFFERED=1
 
 
 
7
 
8
  # Set working directory
9
  WORKDIR /app
10
 
11
- # Copy app code
12
- COPY . /app
13
-
14
- # Install system dependencies
15
- RUN apt-get update && apt-get install -y \
16
- build-essential \
17
- git \
18
- curl \
19
- && rm -rf /var/lib/apt/lists/*
20
-
21
- # Install Python dependencies
22
- RUN pip install --no-cache-dir --upgrade pip \
23
- && pip install --no-cache-dir -r requirements.txt
24
 
25
- # Expose Gradio port
26
- EXPOSE 7860
27
 
28
- # Run the app
29
- CMD ["python", "app.py"]
 
 
 
1
 
2
+ FROM python:3.9
3
+
4
+ # Create a non-root user
5
+ RUN useradd -m -u 1000 user
6
+ USER user
7
+ ENV PATH="/home/user/.local/bin:$PATH"
8
 
9
  # Set working directory
10
  WORKDIR /app
11
 
12
+ # Install dependencies
13
+ COPY --chown=user ./requirements.txt requirements.txt
14
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
 
 
 
 
 
 
 
 
 
 
15
 
16
+ # Copy app files
17
+ COPY --chown=user . /app
18
 
19
+ # Start the app using Streamlit
20
+ CMD ["streamlit", "run", "app.py", "--server.address", "0.0.0.0", "--server.port", "7860"]