Mohammed-Altaf commited on
Commit
e747d37
1 Parent(s): 35598d2

added setup.sh file

Browse files
Files changed (2) hide show
  1. Dockerfile +3 -11
  2. setup.sh +4 -0
Dockerfile CHANGED
@@ -2,20 +2,12 @@ FROM python:3.10-slim
2
 
3
  WORKDIR /app
4
 
5
-
6
- COPY requirements.txt /app/requirements.txt
7
-
8
- RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
9
-
10
  COPY . /app
11
 
12
- # Create a script to set up the directory and environment variable
13
- RUN echo "#!/bin/bash" > /app/setup.sh && \
14
- echo "mkdir -p /app/.cache" > /app/setup.sh && \
15
- echo "export TRANSFORMERS_CACHE=/app/.cache" >> /app/setup.sh && \
16
- chmod +x /app/setup.sh
17
 
18
  EXPOSE 7860
19
 
20
  # Run the script as part of the CMD
21
- CMD ["/app/setup.sh", "&&", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
2
 
3
  WORKDIR /app
4
 
 
 
 
 
 
5
  COPY . /app
6
 
7
+ RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
8
+ RUN chmod +x /app/setup.sh
 
 
 
9
 
10
  EXPOSE 7860
11
 
12
  # Run the script as part of the CMD
13
+ CMD ["/app/setup.sh", "&&", "uvicorn", "/app/main:app", "--host", "0.0.0.0", "--port", "7860"]
setup.sh ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ mkdir -p /app/.cache
4
+ export SENTENCE_TRANSFORMERS_HOME=/app/.cache