Update Dockerfile
Browse files- Dockerfile +48 -18
Dockerfile
CHANGED
@@ -37,36 +37,66 @@
|
|
37 |
# # Run the FastAPI server
|
38 |
# CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
39 |
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
FROM python:3.9-slim
|
42 |
|
43 |
# Set the working directory in the container
|
44 |
WORKDIR /app
|
45 |
|
46 |
-
# Install
|
47 |
-
RUN apt-get update &&
|
48 |
-
|
49 |
-
libpango1.0-dev \
|
50 |
-
libcairo2-dev \
|
51 |
-
libpangocairo-1.0-0 \
|
52 |
-
gcc \
|
53 |
-
g++ \
|
54 |
-
libglib2.0-dev \
|
55 |
ffmpeg \
|
56 |
&& rm -rf /var/lib/apt/lists/*
|
57 |
|
58 |
-
# Upgrade pip to the latest version
|
59 |
-
RUN pip install --upgrade pip
|
60 |
-
|
61 |
-
# Copy the current directory contents into the container at /app
|
62 |
-
COPY . /app
|
63 |
-
|
64 |
# Install Python dependencies
|
|
|
65 |
RUN pip install --no-cache-dir -r requirements.txt
|
66 |
|
67 |
-
#
|
|
|
|
|
|
|
68 |
EXPOSE 7860
|
69 |
|
70 |
-
#
|
71 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
72 |
|
|
|
|
|
|
37 |
# # Run the FastAPI server
|
38 |
# CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
39 |
|
40 |
+
|
41 |
+
|
42 |
+
# # Use an official Python runtime as a parent image
|
43 |
+
# FROM python:3.9-slim
|
44 |
+
|
45 |
+
# # Set the working directory in the container
|
46 |
+
# WORKDIR /app
|
47 |
+
|
48 |
+
# # Install system dependencies required for building the Python packages and ffmpeg
|
49 |
+
# RUN apt-get update && apt-get install -y \
|
50 |
+
# pkg-config \
|
51 |
+
# libpango1.0-dev \
|
52 |
+
# libcairo2-dev \
|
53 |
+
# libpangocairo-1.0-0 \
|
54 |
+
# gcc \
|
55 |
+
# g++ \
|
56 |
+
# libglib2.0-dev \
|
57 |
+
# ffmpeg \
|
58 |
+
# && rm -rf /var/lib/apt/lists/*
|
59 |
+
|
60 |
+
# # Upgrade pip to the latest version
|
61 |
+
# RUN pip install --upgrade pip
|
62 |
+
|
63 |
+
# # Copy the current directory contents into the container at /app
|
64 |
+
# COPY . /app
|
65 |
+
|
66 |
+
# # Install Python dependencies
|
67 |
+
# RUN pip install --no-cache-dir -r requirements.txt
|
68 |
+
|
69 |
+
# # Expose the port your app will run on (adjust based on your app's needs)
|
70 |
+
# EXPOSE 7860
|
71 |
+
|
72 |
+
# # Define the command to run your application
|
73 |
+
# CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
74 |
+
|
75 |
+
|
76 |
+
# Use a Python 3.9 base image
|
77 |
FROM python:3.9-slim
|
78 |
|
79 |
# Set the working directory in the container
|
80 |
WORKDIR /app
|
81 |
|
82 |
+
# Install necessary dependencies
|
83 |
+
RUN apt-get update && \
|
84 |
+
apt-get install -y \
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
ffmpeg \
|
86 |
&& rm -rf /var/lib/apt/lists/*
|
87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
# Install Python dependencies
|
89 |
+
COPY requirements.txt .
|
90 |
RUN pip install --no-cache-dir -r requirements.txt
|
91 |
|
92 |
+
# Copy the application files into the container
|
93 |
+
COPY . .
|
94 |
+
|
95 |
+
# Expose the port for the app
|
96 |
EXPOSE 7860
|
97 |
|
98 |
+
# Set the entry point to run the app
|
99 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
100 |
|
101 |
+
|
102 |
+
|