Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +11 -23
Dockerfile
CHANGED
|
@@ -1,30 +1,18 @@
|
|
|
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
| 3 |
-
#
|
| 4 |
-
RUN apt-get update && apt-get install -y \
|
| 5 |
-
sudo \
|
| 6 |
-
curl \
|
| 7 |
-
pciutils \
|
| 8 |
-
lshw \
|
| 9 |
-
&& apt-get clean \
|
| 10 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
-
|
| 12 |
-
# Install Ollama
|
| 13 |
-
RUN curl -fsSL https://ollama.com/install.sh | sh
|
| 14 |
-
|
| 15 |
-
# Install Python dependencies
|
| 16 |
-
COPY requirements.txt /app/requirements.txt
|
| 17 |
WORKDIR /app
|
| 18 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 19 |
|
| 20 |
-
# Copy
|
| 21 |
-
COPY .
|
|
|
|
| 22 |
|
| 23 |
-
#
|
| 24 |
-
|
| 25 |
|
| 26 |
-
# Expose port
|
| 27 |
-
EXPOSE
|
| 28 |
|
| 29 |
-
# Command to run the app
|
| 30 |
-
CMD ["
|
|
|
|
| 1 |
+
# Use an official Python runtime as a parent image
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
+
# Set the working directory
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
WORKDIR /app
|
|
|
|
| 6 |
|
| 7 |
+
# Copy the requirements file and install dependencies
|
| 8 |
+
COPY requirements.txt .
|
| 9 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 10 |
|
| 11 |
+
# Copy the application code
|
| 12 |
+
COPY main.py .
|
| 13 |
|
| 14 |
+
# Expose the port FastAPI will run on
|
| 15 |
+
EXPOSE 8000
|
| 16 |
|
| 17 |
+
# Command to run the FastAPI app
|
| 18 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|