LucianStorm commited on
Commit
4f5f5ef
·
verified ·
1 Parent(s): fe8c831

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -18
Dockerfile CHANGED
@@ -2,36 +2,22 @@ FROM python:3.9-slim
2
 
3
  WORKDIR /code
4
 
5
- # Create a non-root user
6
- RUN useradd -m -u 1000 user
7
-
8
- # Set up permissions for cache directory
9
- ENV HF_HOME=/home/user/huggingface
10
- RUN mkdir -p /home/user/huggingface && \
11
- chown -R user:user /home/user
12
-
13
  # Install system dependencies
14
  RUN apt-get update && apt-get install -y \
15
  build-essential \
16
- curl \
17
- software-properties-common \
18
  && rm -rf /var/lib/apt/lists/*
19
 
20
  # Copy requirements first for better caching
21
  COPY ./requirements.txt /code/requirements.txt
22
 
23
- # Install Python dependencies
24
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
25
 
26
  # Copy the rest of the application
27
  COPY . .
28
 
29
- # Set permissions
30
- RUN chown -R user:user /code
31
-
32
- # Switch to non-root user
33
- USER user
34
-
35
  # Expose the port
36
  EXPOSE 7860
37
 
 
2
 
3
  WORKDIR /code
4
 
 
 
 
 
 
 
 
 
5
  # Install system dependencies
6
  RUN apt-get update && apt-get install -y \
7
  build-essential \
8
+ git \
 
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
  # Copy requirements first for better caching
12
  COPY ./requirements.txt /code/requirements.txt
13
 
14
+ # Upgrade pip and install dependencies
15
+ RUN pip install --no-cache-dir --upgrade pip && \
16
+ pip install --no-cache-dir -r /code/requirements.txt
17
 
18
  # Copy the rest of the application
19
  COPY . .
20
 
 
 
 
 
 
 
21
  # Expose the port
22
  EXPOSE 7860
23