Update Dockerfile
Browse files- Dockerfile +8 -2
Dockerfile
CHANGED
@@ -7,8 +7,14 @@ COPY . .
|
|
7 |
# Set the working directory to /
|
8 |
WORKDIR /
|
9 |
|
10 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
RUN pip install --no-cache-dir --upgrade -r /requirements.txt
|
12 |
|
13 |
# Start the FastAPI app on port 7860, the default port expected by Spaces
|
14 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
7 |
# Set the working directory to /
|
8 |
WORKDIR /
|
9 |
|
10 |
+
# Create a virtual environment
|
11 |
+
RUN python3 -m venv /opt/venv
|
12 |
+
|
13 |
+
# Activate the virtual environment
|
14 |
+
ENV PATH="/opt/venv/bin:$PATH"
|
15 |
+
|
16 |
+
# Install requirements.txt
|
17 |
RUN pip install --no-cache-dir --upgrade -r /requirements.txt
|
18 |
|
19 |
# Start the FastAPI app on port 7860, the default port expected by Spaces
|
20 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|