Spaces:
Sleeping
Sleeping
Dockerfile added
Browse files- Dockerfile +23 -0
Dockerfile
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use an official Python runtime as a parent image
|
2 |
+
FROM python:3.11-slim
|
3 |
+
|
4 |
+
# Set the working directory to /app
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
|
8 |
+
# Copy the current directory contents into the container at /app
|
9 |
+
COPY . /app
|
10 |
+
|
11 |
+
RUN pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
|
12 |
+
# Install any needed packages specified in requirements.txt
|
13 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
14 |
+
|
15 |
+
# Make port 80 available to the world outside this container
|
16 |
+
EXPOSE 80
|
17 |
+
|
18 |
+
# Define environment variable
|
19 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
20 |
+
|
21 |
+
# Run app.py when the container launches
|
22 |
+
CMD ["uvicorn", "src.serve:app", "--host", "0.0.0.0", "--port", "7860"]
|
23 |
+
|