Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +28 -28
Dockerfile
CHANGED
|
@@ -1,29 +1,29 @@
|
|
| 1 |
-
# Use an official Python runtime as a parent image
|
| 2 |
-
FROM python:3.
|
| 3 |
-
|
| 4 |
-
# Set working directory in the container
|
| 5 |
-
WORKDIR /app
|
| 6 |
-
|
| 7 |
-
# Copy the FastAPI application file
|
| 8 |
-
COPY modelLoanAPI.py /app/modelLoanAPI.py
|
| 9 |
-
|
| 10 |
-
# Copy requirements file (created below)
|
| 11 |
-
COPY requirements.txt /app/requirements.txt
|
| 12 |
-
|
| 13 |
-
COPY requirements.txt /app/extended_worker_dataset.csv
|
| 14 |
-
|
| 15 |
-
# Install system dependencies required for matplotlib and other libraries
|
| 16 |
-
RUN apt-get update && apt-get install -y \
|
| 17 |
-
gcc \
|
| 18 |
-
python3-dev \
|
| 19 |
-
libpq-dev \
|
| 20 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 21 |
-
|
| 22 |
-
# Install Python dependencies
|
| 23 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 24 |
-
|
| 25 |
-
# Expose the port the app runs on
|
| 26 |
-
EXPOSE 7860
|
| 27 |
-
|
| 28 |
-
# Command to run the FastAPI application
|
| 29 |
CMD ["uvicorn", "modelLoanAPI:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
+
# Use an official Python runtime as a parent image
|
| 2 |
+
FROM python:3.9-slim
|
| 3 |
+
|
| 4 |
+
# Set working directory in the container
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Copy the FastAPI application file
|
| 8 |
+
COPY modelLoanAPI.py /app/modelLoanAPI.py
|
| 9 |
+
|
| 10 |
+
# Copy requirements file (created below)
|
| 11 |
+
COPY requirements.txt /app/requirements.txt
|
| 12 |
+
|
| 13 |
+
COPY requirements.txt /app/extended_worker_dataset.csv
|
| 14 |
+
|
| 15 |
+
# Install system dependencies required for matplotlib and other libraries
|
| 16 |
+
RUN apt-get update && apt-get install -y \
|
| 17 |
+
gcc \
|
| 18 |
+
python3-dev \
|
| 19 |
+
libpq-dev \
|
| 20 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 21 |
+
|
| 22 |
+
# Install Python dependencies
|
| 23 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 24 |
+
|
| 25 |
+
# Expose the port the app runs on
|
| 26 |
+
EXPOSE 7860
|
| 27 |
+
|
| 28 |
+
# Command to run the FastAPI application
|
| 29 |
CMD ["uvicorn", "modelLoanAPI:app", "--host", "0.0.0.0", "--port", "7860"]
|