d-e-e-k-11 commited on
Commit
4850b41
·
verified ·
1 Parent(s): 9a99373

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -22
Dockerfile CHANGED
@@ -1,33 +1,21 @@
1
- FROM python:3.10-slim
2
 
3
- # Set environment variables
4
- ENV PYTHONDONTWRITEBYTECODE 1
5
- ENV PYTHONUNBUFFERED 1
6
 
7
- # Install system dependencies
8
- RUN apt-get update && apt-get install -y \
9
- libgl1-mesa-glx \
10
- libglib2.0-0 \
11
- && rm -rf /var/lib/apt/lists/*
12
 
13
- # Create user
 
 
 
 
 
14
  RUN useradd -m -u 1000 user
15
  USER user
16
  ENV HOME=/home/user \
17
  PATH=/home/user/.local/bin:$PATH
18
 
19
  WORKDIR $HOME/app
 
20
 
21
- # Install python dependencies
22
- COPY --chown=user requirements.txt .
23
- RUN pip install --no-cache-dir --upgrade pip && \
24
- pip install --no-cache-dir -r requirements.txt
25
-
26
- # Copy application files
27
- COPY --chown=user . .
28
-
29
- # Expose port
30
- EXPOSE 7860
31
-
32
- # Run the application with gunicorn
33
  CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]
 
1
+ FROM python:3.10
2
 
3
+ WORKDIR /code
 
 
4
 
5
+ COPY ./requirements.txt /code/requirements.txt
 
 
 
 
6
 
7
+ RUN pip install --no-cache-dir --upgrade pip
8
+ RUN pip install --no-cache-dir -r /code/requirements.txt
9
+
10
+ COPY . .
11
+
12
+ # Set permissions for the user
13
  RUN useradd -m -u 1000 user
14
  USER user
15
  ENV HOME=/home/user \
16
  PATH=/home/user/.local/bin:$PATH
17
 
18
  WORKDIR $HOME/app
19
+ COPY --chown=user . $HOME/app
20
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]