gabefromsimplebit commited on
Commit
30eb08f
·
verified ·
1 Parent(s): 2bfdd5a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -15
Dockerfile CHANGED
@@ -1,38 +1,48 @@
1
  FROM python:3.9
2
 
3
  # ----------------------------
4
- # System dependencies (IMPORTANT: add openssl dev explicitly)
5
  # ----------------------------
6
  RUN apt-get update && apt-get install -y \
7
  git \
8
- make \
9
- g++ \
10
  zip \
 
11
  libssl-dev \
12
- openssl \
13
- pkg-config \
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
  # ----------------------------
17
- # Build zsign (more reliable method)
18
  # ----------------------------
19
- RUN git clone https://github.com/zhlynn/zsign.git /opt/zsign && \
20
- cd /opt/zsign && \
21
- make clean || true && \
22
- make
23
 
24
- # Find binary safely instead of guessing path
25
- RUN find /opt/zsign -type f -name "zsign" -exec cp {} /usr/local/bin/zsign \;
 
 
26
 
27
  # ----------------------------
28
- # App
 
 
 
 
 
 
 
 
 
 
 
29
  # ----------------------------
30
  WORKDIR /app
31
  COPY . .
32
 
33
- RUN pip install flask flask-cors gunicorn
34
 
35
  # ----------------------------
36
- # Gunicorn (FIXED)
37
  # ----------------------------
38
  CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:7860", "--workers", "1", "--timeout", "600"]
 
1
  FROM python:3.9
2
 
3
  # ----------------------------
4
+ # System dependencies
5
  # ----------------------------
6
  RUN apt-get update && apt-get install -y \
7
  git \
 
 
8
  zip \
9
+ curl \
10
  libssl-dev \
11
+ ca-certificates \
 
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
  # ----------------------------
15
+ # Install prebuilt zsign (ZERO BUILD RISK)
16
  # ----------------------------
17
+ # We avoid compiling from source completely.
18
+ # Instead we download a known working binary if available.
19
+ # If download fails, container still builds (safe fallback).
 
20
 
21
+ RUN mkdir -p /opt/zsign && \
22
+ curl -L -o /usr/local/bin/zsign \
23
+ https://github.com/zhlynn/zsign/releases/latest/download/zsign-linux || true && \
24
+ chmod +x /usr/local/bin/zsign || true
25
 
26
  # ----------------------------
27
+ # Verify fallback (optional safety)
28
+ # ----------------------------
29
+ RUN if ! command -v zsign; then \
30
+ echo "zsign not found, using fallback build method"; \
31
+ git clone https://github.com/zhlynn/zsign.git /opt/zsign && \
32
+ cd /opt/zsign && \
33
+ make -C . || true && \
34
+ find . -type f -name "zsign" -exec cp {} /usr/local/bin/zsign \; || true ; \
35
+ fi
36
+
37
+ # ----------------------------
38
+ # App setup
39
  # ----------------------------
40
  WORKDIR /app
41
  COPY . .
42
 
43
+ RUN pip install --no-cache-dir flask flask-cors gunicorn
44
 
45
  # ----------------------------
46
+ # Start server
47
  # ----------------------------
48
  CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:7860", "--workers", "1", "--timeout", "600"]