Spaces:
Running
Running
API-Handler
commited on
Update Dockerfile
Browse files- Dockerfile +26 -23
Dockerfile
CHANGED
@@ -1,24 +1,27 @@
|
|
1 |
-
# Use an official Python runtime as the base image
|
2 |
-
FROM python:3.9-slim
|
3 |
-
|
4 |
-
#
|
5 |
-
|
6 |
-
|
7 |
-
#
|
8 |
-
|
9 |
-
|
10 |
-
#
|
11 |
-
|
12 |
-
|
13 |
-
#
|
14 |
-
RUN
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
#
|
21 |
-
|
22 |
-
|
23 |
-
#
|
|
|
|
|
|
|
24 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
+
# Use an official Python runtime as the base image
|
2 |
+
FROM python:3.9-slim
|
3 |
+
|
4 |
+
# Install wget
|
5 |
+
RUN apt-get update && apt-get install -y wget && rm -rf /var/lib/apt/lists/*
|
6 |
+
|
7 |
+
# Set the working directory in the container
|
8 |
+
WORKDIR /app
|
9 |
+
|
10 |
+
# Copy the requirements file into the container
|
11 |
+
COPY requirements.txt .
|
12 |
+
|
13 |
+
# Install the required packages
|
14 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
15 |
+
|
16 |
+
# Download required files
|
17 |
+
RUN wget https://huggingface.co/datasets/API-Handler/DDC-Free-API/resolve/main/api_handler.py && \
|
18 |
+
wget https://huggingface.co/datasets/API-Handler/DDC-Free-API/resolve/main/main.py
|
19 |
+
|
20 |
+
# Copy the rest of the application code into the container
|
21 |
+
COPY . .
|
22 |
+
|
23 |
+
# Expose the port that FastAPI will run on
|
24 |
+
EXPOSE 7860
|
25 |
+
|
26 |
+
# Command to run the FastAPI application
|
27 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|