angry-meow commited on
Commit
5b5fff9
·
1 Parent(s): a359b40

updated docker file

Browse files
Files changed (2) hide show
  1. Dockerfile +24 -10
  2. Dockerfile.old +11 -0
Dockerfile CHANGED
@@ -1,11 +1,25 @@
1
- FROM python:3.10
2
- RUN useradd -m -u 1000 user
3
- USER user
4
- ENV HOME=/home/user \
5
- PATH=/home/user/.local/bin:$PATH
6
- WORKDIR $HOME/app
7
- COPY --chown=user . $HOME/app
8
- COPY ./requirements.txt ~/app/requirements.txt
9
- RUN pip install --no-cache-dir -r requirements.txt
10
- COPY . .
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  CMD ["chainlit", "run", "app.py", "--port", "7860"]
 
1
+ FROM python:3.10
2
+
3
+ # Create user and set up directories
4
+ RUN useradd -m -u 1000 user
5
+ WORKDIR /home/user/app
6
+
7
+ # Create .chainlit directory with correct permissions
8
+ RUN mkdir -p /home/user/.chainlit && chown -R user:user /home/user/.chainlit
9
+
10
+ # Copy requirements and install dependencies
11
+ COPY requirements.txt .
12
+ RUN pip install --no-cache-dir -r requirements.txt
13
+
14
+ # Copy application files
15
+ COPY --chown=user:user . .
16
+
17
+ # Switch to the user
18
+ USER user
19
+
20
+ # Set environment variables
21
+ ENV HOME=/home/user \
22
+ PATH=/home/user/.local/bin:$PATH
23
+
24
+ # Run the application
25
  CMD ["chainlit", "run", "app.py", "--port", "7860"]
Dockerfile.old ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10
2
+ RUN useradd -m -u 1000 user
3
+ USER user
4
+ ENV HOME=/home/user \
5
+ PATH=/home/user/.local/bin:$PATH
6
+ WORKDIR $HOME/app
7
+ COPY --chown=user . $HOME/app
8
+ COPY ./requirements.txt ~/app/requirements.txt
9
+ RUN pip install --no-cache-dir -r requirements.txt
10
+ COPY . .
11
+ CMD ["chainlit", "run", "app.py", "--port", "7860"]