tweaks
Browse files- Dockerfile +13 -15
Dockerfile
CHANGED
|
@@ -1,30 +1,28 @@
|
|
| 1 |
-
#
|
|
|
|
| 2 |
|
| 3 |
-
#
|
| 4 |
-
|
| 5 |
|
| 6 |
-
# 1. Install FFmpeg
|
| 7 |
-
# Debian/Ubuntu based images allow easy installation via apt
|
| 8 |
RUN apt-get update && \
|
| 9 |
-
apt-get install -y ffmpeg && \
|
| 10 |
rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
-
# Set
|
| 13 |
WORKDIR /app
|
| 14 |
|
| 15 |
-
#
|
| 16 |
COPY requirements.txt /app/requirements.txt
|
| 17 |
|
| 18 |
-
# Install Python dependencies
|
| 19 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 20 |
|
| 21 |
-
#
|
| 22 |
COPY app.py /app/
|
| 23 |
|
| 24 |
-
#
|
| 25 |
EXPOSE 8080
|
| 26 |
|
| 27 |
-
#
|
| 28 |
-
|
| 29 |
-
# Format: 'module_name:app_variable_name' -> 'app:ffmpeg_app'
|
| 30 |
-
CMD exec gunicorn --bind 0.0.0.0:8080 --workers 2 app:ffmpeg_app
|
|
|
|
| 1 |
+
# Use an updated, secure Python image
|
| 2 |
+
FROM python:3.10-slim-bullseye
|
| 3 |
|
| 4 |
+
# Prevent interactive prompts during package installs
|
| 5 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 6 |
|
| 7 |
+
# 1. Install FFmpeg and any essential system dependencies
|
|
|
|
| 8 |
RUN apt-get update && \
|
| 9 |
+
apt-get install -y --no-install-recommends ffmpeg && \
|
| 10 |
rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
+
# 2. Set working directory
|
| 13 |
WORKDIR /app
|
| 14 |
|
| 15 |
+
# 3. Copy requirements first (better caching)
|
| 16 |
COPY requirements.txt /app/requirements.txt
|
| 17 |
|
| 18 |
+
# 4. Install Python dependencies
|
| 19 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 20 |
|
| 21 |
+
# 5. Copy your Flask application file
|
| 22 |
COPY app.py /app/
|
| 23 |
|
| 24 |
+
# 6. Expose the port
|
| 25 |
EXPOSE 8080
|
| 26 |
|
| 27 |
+
# 7. Command to run your app via Gunicorn
|
| 28 |
+
CMD exec gunicorn --bind 0.0.0.0:8080 --workers 2 app:ffmpeg_app
|
|
|
|
|
|