arajshiva commited on
Commit
6d7746f
·
verified ·
1 Parent(s): 4bd70f6

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -12
Dockerfile CHANGED
@@ -1,21 +1,18 @@
1
 
2
  ######################## WRITE YOUR DOCKERFILE SCRIPT HERE #########################
3
  # Use official Python image
4
- FROM python:3.10-slim
5
 
6
- # Set environment variables
7
- ENV PYTHONDONTWRITEBYTECODE=1
8
- ENV PYTHONUNBUFFERED=1
9
 
10
- # Set working directory
11
  WORKDIR /app
12
 
13
- # Copy app code
14
- COPY . .
15
 
16
- # Install Python dependencies
17
- RUN pip install --upgrade pip
18
- RUN pip install -r requirements.txt
19
 
20
- # Command to run the app
21
- CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.enableCORS=false"]
 
1
 
2
  ######################## WRITE YOUR DOCKERFILE SCRIPT HERE #########################
3
  # Use official Python image
4
+ FROM python:3.9
5
 
6
+ RUN useradd -m -u 1000 user
7
+ USER user
8
+ ENV PATH="/home/user/.local/bin:$PATH"
9
 
 
10
  WORKDIR /app
11
 
12
+ COPY --chown=user ./requirements.txt requirements.txt
13
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
 
15
+ COPY --chown=user . /app
 
 
16
 
17
+ # Start the Streamlit app on port 7860, the default port expected by Spaces
18
+ CMD ["streamlit", "run", "app.py", "--host", "0.0.0.0", "--port", "7860"]