gabefromsimplebit commited on
Commit
8770f0a
·
verified ·
1 Parent(s): 30eb08f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -34
Dockerfile CHANGED
@@ -1,48 +1,27 @@
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"]
 
1
  FROM python:3.9
2
 
3
+ # 1. Install system dependencies
 
 
4
  RUN apt-get update && apt-get install -y \
5
+ g++ \
6
+ libssl-dev \
7
  git \
8
  zip \
9
+ make \
10
  curl \
11
+ pkg-config \
 
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
+ # 2. Build zsign (old style, fixed path)
15
+ RUN git clone https://github.com/zhlynn/zsign.git /opt/zsign && \
16
+ cd /opt/zsign && \
17
+ make && \
18
+ find . -type f -name "zsign" -exec cp {} /usr/local/bin/zsign \;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
+ # 3. Setup App
 
 
21
  WORKDIR /app
22
  COPY . .
23
 
24
+ RUN pip install flask flask-cors gunicorn
25
 
26
+ # 4. Start (IMPORTANT: correct JSON format)
 
 
27
  CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:7860", "--workers", "1", "--timeout", "600"]