File size: 1,303 Bytes
7508243
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ae90bdc
008fc72
7508243
 
 
 
 
 
 
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
# 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"]