nikhilkomakula commited on
Commit
8060396
·
1 Parent(s): 8b045ff

New Updates to Dockerfile

Browse files
Files changed (2) hide show
  1. Dockerfile +24 -14
  2. README.md +2 -2
Dockerfile CHANGED
@@ -1,25 +1,35 @@
1
  FROM python:3.11.5-slim
2
 
3
- RUN useradd -m -u 1000 user
4
- USER user
 
 
 
5
 
6
- WORKDIR /app
 
7
 
8
- RUN chown -R user:user /app
 
 
 
 
9
 
10
- # Copy the application files into the container
11
- COPY --chown=user:user requirements.txt /app/
12
- COPY --chown=user:user app.py /app/
13
 
14
- # Install dependencies
15
- RUN pip install --no-cache-dir --upgrade pip && \
16
- pip install --no-cache-dir -r requirements.txt
17
 
18
- COPY --chown=user:user src /app/src
19
- COPY --chown=user:user indexes /app/indexes
 
 
20
 
21
- # Expose the port on which your application runs inside the container
22
- EXPOSE 7860
 
23
 
24
  # Use ENTRYPOINT to specify the command to run when the container starts
25
  ENTRYPOINT ["python", "app.py"]
 
1
  FROM python:3.11.5-slim
2
 
3
+ # Set the working directory to /code
4
+ WORKDIR /code
5
+
6
+ # Copy requirements.txt to working directory
7
+ COPY requirements.txt ./
8
 
9
+ # Upgrade pip and install dependencies
10
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
11
 
12
+ # Set up a new user named "user" with user ID 1000
13
+ RUN useradd -m -u 1000 user
14
+
15
+ # Switch to the "user" user
16
+ USER user
17
 
18
+ # Set home to the user's home directory
19
+ ENV HOME=/home/user \
20
+ PATH=/home/user/.local/bin:$PATH
21
 
22
+ # Set the working directory to the user's home directory
23
+ WORKDIR $HOME/app
 
24
 
25
+ # Copy the files/folders into the container at $HOME/app setting the owner to the user
26
+ COPY --chown=user app.py $HOME/app
27
+ COPY --chown=user src $HOME/app/src
28
+ COPY --chown=user indexes $HOME/app/indexes
29
 
30
+ # Copy git lfs files
31
+ RUN --chown=user cd $HOME/app/indexes && git lfs pull -I "indexes/chroma.sqlite3"
32
+ RUN --chown=user cd $HOME/app/indexes/c607d7bb-5476-4bdc-8df3-36895a74111c && git lfs pull -I "indexes/c607d7bb-5476-4bdc-8df3-36895a74111c/data_level0.bin"
33
 
34
  # Use ENTRYPOINT to specify the command to run when the container starts
35
  ENTRYPOINT ["python", "app.py"]
README.md CHANGED
@@ -4,10 +4,10 @@ emoji: 🤖
4
  colorFrom: yellow
5
  colorTo: pink
6
  sdk: docker
 
7
  pinned: true
8
  license: mit
9
  ---
10
-
11
  [![Sync to Hugging Face hub](https://github.com/nikhilkomakula/llm-rag-op-chatbot/actions/workflows/main.yml/badge.svg)](https://github.com/nikhilkomakula/llm-rag-op-chatbot/actions/workflows/main.yml)
12
 
13
  [Try OpenPages IntelliBot Here!](https://huggingface.co/spaces/nikhilkomakula/llm-rag-op-chatbot)
@@ -125,7 +125,7 @@ docker logs -f llm-rag-op-chatbot
125
 
126
  For any inquiries or feedback, please contact me at [[email protected]](mailto:[email protected]).
127
 
128
- ## License:
129
 
130
  This project is licensed under the [MIT License](https://opensource.org/licenses/MIT) - see the [LICENSE](LICENSE) file for details.
131
 
 
4
  colorFrom: yellow
5
  colorTo: pink
6
  sdk: docker
7
+ app_port: 7860
8
  pinned: true
9
  license: mit
10
  ---
 
11
  [![Sync to Hugging Face hub](https://github.com/nikhilkomakula/llm-rag-op-chatbot/actions/workflows/main.yml/badge.svg)](https://github.com/nikhilkomakula/llm-rag-op-chatbot/actions/workflows/main.yml)
12
 
13
  [Try OpenPages IntelliBot Here!](https://huggingface.co/spaces/nikhilkomakula/llm-rag-op-chatbot)
 
125
 
126
  For any inquiries or feedback, please contact me at [[email protected]](mailto:[email protected]).
127
 
128
+ ## License:
129
 
130
  This project is licensed under the [MIT License](https://opensource.org/licenses/MIT) - see the [LICENSE](LICENSE) file for details.
131