Nafiul Huda commited on
Commit
bf6977e
·
verified ·
1 Parent(s): f315b0e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -7
Dockerfile CHANGED
@@ -1,30 +1,37 @@
1
- # MCPanel — single-file Flask Minecraft host for HuggingFace Docker Spaces
2
  FROM debian:stable-slim
3
 
4
  ENV DEBIAN_FRONTEND=noninteractive
 
5
 
6
- # base tools
7
  RUN apt-get update && \
8
  apt-get install -y --no-install-recommends \
9
- ca-certificates curl python3 python3-pip procps unzip && \
10
  rm -rf /var/lib/apt/lists/*
11
 
12
- # OpenJDK 21 + 25 (native on Debian 13, covers all current MC builds).
13
- # 8/17 auto-provisioned at runtime if an older version is installed.
14
  RUN apt-get update && \
15
  (apt-get install -y --no-install-recommends openjdk-21-jre-headless || true) && \
16
  (apt-get install -y --no-install-recommends openjdk-25-jre-headless || \
17
  apt-get install -y --no-install-recommends default-jre-headless || true) && \
18
  rm -rf /var/lib/apt/lists/*
19
 
 
20
  COPY requirements.txt /tmp/requirements.txt
21
  RUN python3 -m pip install --no-cache-dir --break-system-packages -r /tmp/requirements.txt && \
22
  rm -f /tmp/requirements.txt
23
 
 
24
  WORKDIR /app
25
  COPY app.py /app/app.py
26
- RUN chmod +x /app/app.py && mkdir -p /data && chmod 777 /data
 
 
 
 
 
27
 
28
  EXPOSE 7860
29
 
30
- CMD ["python3", "/app/app.py"]
 
 
 
1
  FROM debian:stable-slim
2
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
+ ENV SERVER_DIR=/data
5
 
6
+ # Install base OS tools
7
  RUN apt-get update && \
8
  apt-get install -y --no-install-recommends \
9
+ ca-certificates curl python3 python3-pip procps unzip wget && \
10
  rm -rf /var/lib/apt/lists/*
11
 
12
+ # Install Java Environment (OpenJDK 21 & 25)
 
13
  RUN apt-get update && \
14
  (apt-get install -y --no-install-recommends openjdk-21-jre-headless || true) && \
15
  (apt-get install -y --no-install-recommends openjdk-25-jre-headless || \
16
  apt-get install -y --no-install-recommends default-jre-headless || true) && \
17
  rm -rf /var/lib/apt/lists/*
18
 
19
+ # Install Python requirements
20
  COPY requirements.txt /tmp/requirements.txt
21
  RUN python3 -m pip install --no-cache-dir --break-system-packages -r /tmp/requirements.txt && \
22
  rm -f /tmp/requirements.txt
23
 
24
+ # Setup application workspace
25
  WORKDIR /app
26
  COPY app.py /app/app.py
27
+ COPY start.sh /app/start.sh
28
+
29
+ # Make scripts executable and prepare mount point
30
+ RUN chmod +x /app/app.py /app/start.sh && \
31
+ mkdir -p /data && \
32
+ chmod 777 /data
33
 
34
  EXPOSE 7860
35
 
36
+ # Execute the startup script instead of app.py directly
37
+ CMD ["/bin/bash", "/app/start.sh"]