Update Dockerfile
Browse files- Dockerfile +20 -25
Dockerfile
CHANGED
@@ -37,44 +37,39 @@
|
|
37 |
# # Run the FastAPI server
|
38 |
# CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
39 |
|
40 |
-
|
41 |
-
# Use the official Python image as a base image
|
42 |
FROM python:3.9-slim
|
43 |
|
44 |
-
# Set
|
45 |
-
ENV PYTHONUNBUFFERED=1
|
46 |
-
|
47 |
-
# Set working directory
|
48 |
WORKDIR /app
|
49 |
|
50 |
-
# Install system dependencies
|
51 |
RUN apt-get update && apt-get install -y \
|
52 |
-
libfreetype6-dev \
|
53 |
-
libx11-dev \
|
54 |
-
libx264-dev \
|
55 |
-
ffmpeg \
|
56 |
-
build-essential \
|
57 |
pkg-config \
|
58 |
-
libcairo2-dev \
|
59 |
-
&& rm -rf /var/lib/apt/lists/*
|
60 |
libpango1.0-dev \
|
|
|
61 |
libpangocairo-1.0-0 \
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
|
63 |
-
# Copy the
|
64 |
-
COPY
|
65 |
|
66 |
# Install Python dependencies
|
67 |
RUN pip install --no-cache-dir -r requirements.txt
|
68 |
|
69 |
-
#
|
70 |
-
|
71 |
-
chmod -R 775 /app/media
|
72 |
|
73 |
-
#
|
74 |
-
|
75 |
|
76 |
-
#
|
77 |
-
|
|
|
78 |
|
79 |
-
# Command to run the FastAPI app with uvicorn
|
80 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
37 |
# # Run the FastAPI server
|
38 |
# CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
39 |
|
40 |
+
# Use an official Python runtime as a parent image
|
|
|
41 |
FROM python:3.9-slim
|
42 |
|
43 |
+
# Set the working directory in the container
|
|
|
|
|
|
|
44 |
WORKDIR /app
|
45 |
|
46 |
+
# Install system dependencies required for building the Python packages
|
47 |
RUN apt-get update && apt-get install -y \
|
|
|
|
|
|
|
|
|
|
|
48 |
pkg-config \
|
|
|
|
|
49 |
libpango1.0-dev \
|
50 |
+
libcairo2-dev \
|
51 |
libpangocairo-1.0-0 \
|
52 |
+
gcc \
|
53 |
+
g++ \
|
54 |
+
libglib2.0-dev \
|
55 |
+
&& rm -rf /var/lib/apt/lists/*
|
56 |
+
|
57 |
+
# Upgrade pip to the latest version
|
58 |
+
RUN pip install --upgrade pip
|
59 |
|
60 |
+
# Copy the current directory contents into the container at /app
|
61 |
+
COPY . /app
|
62 |
|
63 |
# Install Python dependencies
|
64 |
RUN pip install --no-cache-dir -r requirements.txt
|
65 |
|
66 |
+
# Set environment variables (if necessary)
|
67 |
+
# ENV SOME_ENV_VAR=value
|
|
|
68 |
|
69 |
+
# Expose the port your app will run on (adjust based on your app's needs)
|
70 |
+
EXPOSE 8000
|
71 |
|
72 |
+
# Define the command to run your application
|
73 |
+
# Replace this with the command to run your application, e.g., python app.py
|
74 |
+
CMD ["python", "app.py"]
|
75 |
|
|
|
|