Update Dockerfile
Browse files- Dockerfile +22 -8
Dockerfile
CHANGED
@@ -1,16 +1,30 @@
|
|
|
|
1 |
FROM python:3.9
|
2 |
|
3 |
-
|
|
|
4 |
|
5 |
-
|
6 |
-
|
|
|
7 |
|
8 |
-
|
|
|
9 |
|
10 |
-
|
|
|
11 |
|
12 |
-
|
|
|
13 |
|
14 |
-
|
|
|
15 |
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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"]
|