nikhilkomakula commited on
Commit
f49fee2
·
1 Parent(s): ecab12d
Files changed (2) hide show
  1. .github/workflows/main.yml +2 -2
  2. Dockerfile +8 -15
.github/workflows/main.yml CHANGED
@@ -31,11 +31,11 @@ jobs:
31
  env:
32
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
33
  run: |
34
- git remote add space https://nikhilkomakula:[email protected]/spaces/nikhilkomakula/llm-rag-op-chatbot3 || true
35
 
36
  - name: Push to hub
37
  env:
38
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
39
  run: |
40
- git push --force https://nikhilkomakula:[email protected]/spaces/nikhilkomakula/llm-rag-op-chatbot3 main
41
  exit 0
 
31
  env:
32
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
33
  run: |
34
+ git remote add space https://nikhilkomakula:[email protected]/spaces/nikhilkomakula/llm-rag-op-chatbot || true
35
 
36
  - name: Push to hub
37
  env:
38
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
39
  run: |
40
+ git push --force https://nikhilkomakula:[email protected]/spaces/nikhilkomakula/llm-rag-op-chatbot main
41
  exit 0
Dockerfile CHANGED
@@ -4,7 +4,7 @@ FROM python:3.11.5-slim
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 --upgrade pip && \
@@ -16,10 +16,6 @@ RUN apt-get update && \
16
  apt-get install -y git && \
17
  apt-get install -y git-lfs
18
 
19
- # Expose the secret SECRET_EXAMPLE at buildtime and use its value to clone the repo
20
- RUN --mount=type=secret,id=HUGGINGFACEHUB_API_TOKEN,mode=0444,required=true \
21
- git clone --depth 1 https://nikhilkomakula:$(cat /run/secrets/HUGGINGFACEHUB_API_TOKEN)@huggingface.co/spaces/nikhilkomakula/llm-rag-op-chatbot3 /code/llm-rag-op-chatbot3
22
-
23
  # Set up a new user named "user" with user ID 1000
24
  RUN useradd -m -u 1000 user
25
 
@@ -33,16 +29,13 @@ ENV HOME=/home/user \
33
  # Set the working directory to the user's home directory
34
  WORKDIR $HOME/app
35
 
36
- # Copy the files/folders into the container at $HOME/app setting the owner to the user
37
- COPY --chown=user app.py $HOME/app
38
- COPY --chown=user src $HOME/app/src
39
- COPY --chown=user indexes $HOME/app/indexes
40
-
41
- # Use ENTRYPOINT to specify the command to run when the container starts
42
- ENTRYPOINT ["python", "app.py"]
43
 
44
- # Download LFS files
45
- RUN echo "Downloading LFS files..." && \
46
- cd /code/llm-rag-op-chatbot3/indexes && \
47
  git lfs pull
48
 
 
 
 
4
  WORKDIR /code
5
 
6
  # Copy requirements.txt to working directory
7
+ COPY requirements.txt /code/
8
 
9
  # Upgrade pip and install dependencies
10
  RUN pip install --upgrade pip && \
 
16
  apt-get install -y git && \
17
  apt-get install -y git-lfs
18
 
 
 
 
 
19
  # Set up a new user named "user" with user ID 1000
20
  RUN useradd -m -u 1000 user
21
 
 
29
  # Set the working directory to the user's home directory
30
  WORKDIR $HOME/app
31
 
32
+ # Expose the secret HUGGINGFACEHUB_API_TOKEN at buildtime and use its value to clone the repo
33
+ RUN --mount=type=secret,id=HUGGINGFACEHUB_API_TOKEN,mode=0444,required=true \
34
+ git clone --depth 1 https://nikhilkomakula:$(cat /run/secrets/HUGGINGFACEHUB_API_TOKEN)@huggingface.co/spaces/nikhilkomakula/llm-rag-op-chatbot $HOME/app
 
 
 
 
35
 
36
+ # After cloning, navigate into the repository directory and pull Git LFS files
37
+ RUN cd $HOME/app && \
 
38
  git lfs pull
39
 
40
+ # Use ENTRYPOINT to specify the command to run when the container starts
41
+ ENTRYPOINT ["python", "app.py"]