Newer
Older
# Use a general-purpose Ubuntu image
FROM ubuntu:latest
# Set a non-interactive frontend for apt to avoid prompts
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies
RUN apt-get update && apt-get install -y \
python3.11 \
python3-pip \
python3-venv \
libgl1-mesa-glx \
libsm6 \
libxext6 \
ffmpeg \
curl \
wget \
git \
&& rm -rf /var/lib/apt/lists/*
# Create a virtual environment for Python dependencies
RUN python3 -m venv /env
# Activate the virtual environment and install dependencies from requirements.txt
COPY requirements.txt /requirements.txt
RUN /env/bin/pip install --upgrade pip && \
/env/bin/pip install -r /requirements.txt
# Set the working directory
WORKDIR /src/app
# Copy application files
COPY src/app /src/app
# Command to run the Python app
CMD ["/env/bin/python3", "app.py"]