moraxgiga commited on
Commit
bf1805c
1 Parent(s): bb87cb9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -8
Dockerfile CHANGED
@@ -1,16 +1,30 @@
 
1
  FROM python:3.9
2
 
3
- WORKDIR /code
 
4
 
5
- RUN mkdir -p /code/cache
6
- ENV TRANSFORMERS_CACHE=/code/cache
 
7
 
8
- COPY ./requirements.txt /code/requirements.txt
 
9
 
10
- COPY ./jina /code/jina
 
11
 
12
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
13
 
14
- COPY ./main.py /code/main.py
 
15
 
16
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
  FROM python:3.9
3
 
4
+ # Set the working directory in the container to /app
5
+ WORKDIR /app
6
 
7
+ # Create a cache directory and grant broad permissions
8
+ RUN mkdir -p /app/cache
9
+ RUN chmod -R 777 /app/cache
10
 
11
+ # Set environment variable for Transformers cache
12
+ ENV TRANSFORMERS_CACHE=/app/cache
13
 
14
+ # Copy the requirements file into the container at /app
15
+ COPY ./requirements.txt /app/requirements.txt
16
 
17
+ # Install any needed packages specified in requirements.txt
18
+ RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
19
 
20
+ # Copy the content of the local src directory to /app inside the container
21
+ COPY . /app
22
 
23
+ # Copy the jina directory into the container at /app/jina
24
+ COPY ./jina /app/jina
25
+
26
+ # Make port 7860 available to the world outside this container
27
+ EXPOSE 7860
28
+
29
+ # Define the command to run the app using uvicorn
30
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]