# Use Ubuntu 22.04 as the base image FROM ubuntu:22.04 # Set environment variables to prevent interactive prompts during apt installs ENV DEBIAN_FRONTEND=noninteractive # Update package lists and install necessary packages # - python3: installs Python 3 # - python3-pip: installs pip for Python 3 # - openssh-client: required by paramiko for SSH connections # - build-essential: often needed for compiling some Python packages (e.g., paramiko might need it) # - libgl1-mesa-glx: required by Pillow for image processing (especially if using imageai for image generation) RUN apt-get update && \ apt-get install -y --no-install-recommends \ python3 \ python3-pip \ openssh-client \ build-essential \ libgl1-mesa-glx && \ rm -rf /var/lib/apt/lists/* # Set the working directory in the container WORKDIR /app # Copy requirements.txt and install Python dependencies COPY requirements.txt . RUN pip3 install --no-cache-dir -r requirements.txt # Copy the application code into the container COPY * . COPY anon.session /tmp/anon.season # Create the image cache directory (ensure write permissions) RUN mkdir -p image_cache # Command to run the application # Use python3 -u to ensure unbuffered output, which is good for logging in Docker/Spaces CMD ["python3", "-u", "app.py"]