File size: 1,173 Bytes
5cb3215
 
 
bf6977e
5cb3215
bf6977e
5cb3215
 
bf6977e
5cb3215
 
bf6977e
5cb3215
 
 
 
 
 
bf6977e
5cb3215
 
 
 
bf6977e
5cb3215
00592e3
bf6977e
 
 
 
 
 
5cb3215
 
 
bf6977e
 
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
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"]