Update Dockerfile
Browse files- Dockerfile +51 -16
Dockerfile
CHANGED
@@ -73,30 +73,65 @@
|
|
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
|
83 |
-
|
84 |
-
|
85 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
&& rm -rf /var/lib/apt/lists/*
|
87 |
|
88 |
-
#
|
|
|
|
|
|
|
89 |
COPY requirements.txt .
|
90 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
91 |
|
92 |
-
|
|
|
|
|
|
|
93 |
COPY . .
|
94 |
|
95 |
-
# Expose the port for the app
|
96 |
EXPOSE 7860
|
97 |
|
98 |
-
#
|
99 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
100 |
-
|
101 |
-
|
102 |
-
|
|
|
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 |
+
|
103 |
+
# Use the official Python image
|
104 |
+
FROM python:3.9-slim
|
105 |
+
|
106 |
+
# Set environment variables
|
107 |
+
ENV PYTHONDONTWRITEBYTECODE 1
|
108 |
+
ENV PYTHONUNBUFFERED 1
|
109 |
+
|
110 |
+
# Install system dependencies
|
111 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
112 |
+
gcc \
|
113 |
+
g++ \
|
114 |
+
clang \
|
115 |
+
make \
|
116 |
+
pkg-config \
|
117 |
+
libcairo2-dev \
|
118 |
+
libffi-dev \
|
119 |
+
python3-dev \
|
120 |
&& rm -rf /var/lib/apt/lists/*
|
121 |
|
122 |
+
# Set the working directory
|
123 |
+
WORKDIR /app
|
124 |
+
|
125 |
+
# Copy requirements file and install dependencies
|
126 |
COPY requirements.txt .
|
|
|
127 |
|
128 |
+
RUN pip install --upgrade pip && \
|
129 |
+
pip install --no-cache-dir -r requirements.txt
|
130 |
+
|
131 |
+
# Copy application code
|
132 |
COPY . .
|
133 |
|
|
|
134 |
EXPOSE 7860
|
135 |
|
136 |
+
# Define the entrypoint (replace this with your command, e.g., flask or uvicorn)
|
137 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
|
|