AAnvar commited on
Commit
a30e851
·
verified ·
1 Parent(s): f6424c4

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -13
Dockerfile CHANGED
@@ -1,20 +1,32 @@
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"]
 
1
 
2
+ ######################## WRITE YOUR DOCKERFILE SCRIPT HERE #########################
3
 
4
+ # Use the official Python base image
5
+ FROM python:3.11-slim
 
 
6
 
7
+ # Set environment variables
8
+ ENV PYTHONDONTWRITEBYTECODE=1
9
+ ENV PYTHONUNBUFFERED=1
10
+
11
+ # Set the working directory in the container
12
  WORKDIR /app
13
 
14
+ # Copy the current directory contents into the container at /app
15
+ COPY . /app
16
+
17
+ # Install system dependencies
18
+ RUN apt-get update && apt-get install -y \
19
+ build-essential \
20
+ git \
21
+ curl \
22
+ && rm -rf /var/lib/apt/lists/*
23
+
24
+ # Install Python dependencies
25
+ RUN pip install --no-cache-dir --upgrade pip \
26
+ && pip install --no-cache-dir -r requirements.txt
27
 
28
+ # Expose the port that Gradio will run on
29
+ EXPOSE 7860
30
 
31
+ # Run the app
32
+ CMD ["python", "app.py"]