FROM debian:stable-slim ENV DEBIAN_FRONTEND=noninteractive ENV SERVER_DIR=/data # Install base OS tools RUN apt-get update && \ apt-get install -y --no-install-recommends \ ca-certificates curl python3 python3-pip procps unzip wget && \ rm -rf /var/lib/apt/lists/* # Install Java Environment (OpenJDK 21 & 25) RUN apt-get update && \ (apt-get install -y --no-install-recommends openjdk-21-jre-headless || true) && \ (apt-get install -y --no-install-recommends openjdk-25-jre-headless || \ apt-get install -y --no-install-recommends default-jre-headless || true) && \ rm -rf /var/lib/apt/lists/* # Install Python requirements COPY requirements.txt /tmp/requirements.txt RUN python3 -m pip install --no-cache-dir --break-system-packages -r /tmp/requirements.txt && \ rm -f /tmp/requirements.txt # Setup application workspace WORKDIR /app COPY app.py /app/app.py COPY start.sh /app/start.sh # Make scripts executable and prepare mount point RUN chmod +x /app/app.py /app/start.sh && \ mkdir -p /data && \ chmod 777 /data EXPOSE 7860 # Execute the startup script instead of app.py directly CMD ["/bin/bash", "/app/start.sh"]