abubasith86 commited on
Commit
d8ed3c7
·
verified ·
1 Parent(s): ecdf4b6

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -9
Dockerfile CHANGED
@@ -1,15 +1,15 @@
1
  FROM python:3.10-slim
2
 
3
- # Create a non-root user
 
 
 
 
 
4
  RUN useradd -m -u 1000 user
5
  USER user
6
- ENV HOME=/home/user
7
- WORKDIR $HOME/app
8
 
9
- # Install git and pip
10
- RUN apt-get update && \
11
- apt-get install -y git && \
12
- pip install --no-cache-dir --upgrade pip
13
 
14
  # Clone your repo
15
  ARG GH_REPO_URL
@@ -19,8 +19,6 @@ RUN git clone --depth 1 --branch main https://github.com/abubasith456/chat-bot-b
19
  # Install Python dependencies from the cloned repo
20
  RUN pip install --no-cache-dir -r requirements.txt
21
 
22
- # Expose HF default port
23
  EXPOSE 7860
24
 
25
- # Run your application
26
  CMD ["python", "main.py"]
 
1
  FROM python:3.10-slim
2
 
3
+ # Install git & pip as root
4
+ USER root
5
+ RUN apt-get update && apt-get install -y git && \
6
+ pip install --no-cache-dir --upgrade pip
7
+
8
+ # Create and switch to a non-root user for the app
9
  RUN useradd -m -u 1000 user
10
  USER user
 
 
11
 
12
+ WORKDIR /home/user/app
 
 
 
13
 
14
  # Clone your repo
15
  ARG GH_REPO_URL
 
19
  # Install Python dependencies from the cloned repo
20
  RUN pip install --no-cache-dir -r requirements.txt
21
 
 
22
  EXPOSE 7860
23
 
 
24
  CMD ["python", "main.py"]