File size: 3,188 Bytes
6053f59
 
74e33e5
6053f59
 
 
29d4fa3
6053f59
0ded72b
6053f59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5a1e192
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
de08852
 
6053f59
de08852
 
 
 
 
 
 
 
6053f59
de08852
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dbe2549
 
de08852
dbe2549
e7d5f0c
 
de08852
 
 
 
5a1e192
29d4fa3
de08852
 
 
 
5a1e192
 
4a272ea
6053f59
de08852
4a272ea
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# # Use an official Python base image
# FROM python:3.9

# # Set environment variables
# ENV PYTHONUNBUFFERED=1 \
#     PYTHONDONTWRITEBYTECODE=1

# RUN pip install importlib-metadata

# # Install required system libraries for Manim and dependencies
# RUN apt-get update && apt-get install -y \
#     ffmpeg \
#     libcairo2 \
#     libpango1.0-0 \
#     libx11-6 \
#     libgl1-mesa-glx \
#     xvfb \
#     pkg-config \
#     libpango1.0-dev \
#     libcairo2-dev \
#     && apt-get clean

# # Set the working directory
# WORKDIR /app

# # Copy project files
# COPY . /app

# # Install Python dependencies
# RUN pip install --no-cache-dir --upgrade pip
# COPY requirements.txt .
# RUN pip install --no-cache-dir -r requirements.txt

# # Expose the port
# EXPOSE 7860

# # Run the FastAPI server
# CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]



# # Use an official Python runtime as a parent image
# FROM python:3.9-slim

# # Set the working directory in the container
# WORKDIR /app

# # Install system dependencies required for building the Python packages and ffmpeg
# RUN apt-get update && apt-get install -y \
#     pkg-config \
#     libpango1.0-dev \
#     libcairo2-dev \
#     libpangocairo-1.0-0 \
#     gcc \
#     g++ \
#     libglib2.0-dev \
#     ffmpeg \
#     && rm -rf /var/lib/apt/lists/*

# # Upgrade pip to the latest version
# RUN pip install --upgrade pip

# # Copy the current directory contents into the container at /app
# COPY . /app

# # Install Python dependencies
# RUN pip install --no-cache-dir -r requirements.txt

# # Expose the port your app will run on (adjust based on your app's needs)
# EXPOSE 7860

# # Define the command to run your application
# CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]


# # Use a Python 3.9 base image
# FROM python:3.9-slim

# # Set the working directory in the container
# WORKDIR /app

# # Install necessary dependencies
# RUN apt-get update && \
#     apt-get install -y \
#     ffmpeg \
#     && rm -rf /var/lib/apt/lists/*

# # Install Python dependencies
# COPY requirements.txt .
# RUN pip install --no-cache-dir -r requirements.txt

# # Copy the application files into the container
# COPY . .

# # Expose the port for the app
# EXPOSE 7860

# # Set the entry point to run the app
# CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]



# Use the official Python image
FROM python:3.9-slim

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    gcc \
    g++ \
    make \
    pkg-config \
    libcairo2-dev \
    libpango1.0-dev \
    libpangocairo-1.0-0 \
    python3-dev \
    libffi-dev \
    && rm -rf /var/lib/apt/lists/*

# Set the working directory
WORKDIR /app

# Copy requirements file and install dependencies
COPY requirements.txt .

RUN pip install --upgrade pip && \
    pip install --no-cache-dir -r requirements.txt

# Copy application code
COPY . .

EXPOSE 7860

# Define the entrypoint (replace this with your command, e.g., flask or uvicorn)
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]