Artin2009 commited on
Commit
7bcad38
1 Parent(s): ac7111d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +53 -14
Dockerfile CHANGED
@@ -1,5 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  FROM python:3.9
2
- FROM node:19-slim
 
3
  RUN apt-get update && \
4
  apt-get install -y \
5
  bash \
@@ -7,20 +37,29 @@ RUN apt-get update && \
7
  wget curl procps \
8
  htop vim nano && \
9
  rm -rf /var/lib/apt/lists/*
10
- # RUN useradd -m -u 1000 user
11
- # USER user
12
- # ENV HOME=/home/user \
13
- # PATH=/home/user/.local/bin:$PATH
14
-
 
 
 
 
15
  WORKDIR /app
16
- COPY --link ./ /app
17
 
18
- RUN chown 1000 /app
19
- USER 1000
 
 
 
 
 
 
20
 
21
- # COPY --chown=user . $HOME/app
22
- # COPY ./requirements.txt ~/app/requirements.txt
23
- RUN pip install -r requirements.txt
24
 
25
- # COPY . .
26
- CMD ["chainlit", "run", "chain_app.py", "--port", "7860" ,"-h"]
 
1
+ # FROM python:3.9
2
+ # FROM node:19-slim
3
+ # RUN apt-get update && \
4
+ # apt-get install -y \
5
+ # bash \
6
+ # git git-lfs \
7
+ # wget curl procps \
8
+ # htop vim nano && \
9
+ # rm -rf /var/lib/apt/lists/*
10
+ # # RUN useradd -m -u 1000 user
11
+ # # USER user
12
+ # # ENV HOME=/home/user \
13
+ # # PATH=/home/user/.local/bin:$PATH
14
+
15
+ # WORKDIR /app
16
+ # COPY --link ./ /app
17
+
18
+ # RUN chown 1000 /app
19
+ # USER 1000
20
+
21
+ # # COPY --chown=user . $HOME/app
22
+ # # COPY ./requirements.txt ~/app/requirements.txt
23
+ # RUN pip install -r requirements.txt
24
+
25
+ # # COPY . .
26
+ # CMD ["chainlit", "run", "chain_app.py", "--port", "7860" ,"-h"]
27
+
28
+
29
+ # Start from a Python base image
30
  FROM python:3.9
31
+
32
+ # Install necessary packages
33
  RUN apt-get update && \
34
  apt-get install -y \
35
  bash \
 
37
  wget curl procps \
38
  htop vim nano && \
39
  rm -rf /var/lib/apt/lists/*
40
+
41
+ # Create a new user
42
+ RUN useradd -m -u 1000 user
43
+
44
+ # Set environment variables
45
+ ENV HOME=/home/user \
46
+ PATH=/home/user/.local/bin:$PATH
47
+
48
+ # Set working directory
49
  WORKDIR /app
 
50
 
51
+ # Copy the application files
52
+ COPY ./ /app
53
+
54
+ # Change ownership of the application files
55
+ RUN chown -R user:user /app
56
+
57
+ # Switch to the new user
58
+ USER user
59
 
60
+ # Copy and install Python dependencies
61
+ COPY --chown=user:user requirements.txt $HOME/app/requirements.txt
62
+ RUN pip install --no-cache-dir -r $HOME/app/requirements.txt
63
 
64
+ # Set the command to run the application
65
+ CMD ["chainlit", "run", "chain_app.py", "--port", "7860" ,"-h"]