File size: 1,784 Bytes
a86db57
75384c4
 
 
 
 
 
 
 
 
fd8d009
a86db57
75384c4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a86db57
84009f4
 
75384c4
 
 
 
 
 
 
84009f4
 
189b025
 
 
 
75384c4
 
 
 
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
FROM node:22
# Install dependencies
RUN apt update && apt install -y \
    gcc \
    curl \
    wget \
    sudo \
    git-lfs \
    openssl \
    jq \
    python3-pip \
     && rm -rf /var/lib/apt/lists/*

# Install Python packages
RUN pip install --no-cache-dir \
    huggingface_hub \
    datasets
    
    
    
# Add health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
  CMD curl -f http://localhost:7860/ || exit 1
  
COPY Caddyfile /app/Caddyfile

# Copy sync scripts
COPY sync_storage.py /app/sync_storage.py
COPY start_with_sync.sh /start.sh

# Make scripts executable
RUN chmod +x /app/sync_storage.py /start.sh


RUN openlist_url=$(curl -X 'GET' 'https://api.github.com/repos/OpenListTeam/OpenList/releases' -H 'accept: application/json' | jq -r '.[0].assets[] | .browser_download_url | select(. | endswith("linux-amd64.tar.gz"))') && \
echo download OpenList from $openlist_url && \ 
wget  $openlist_url -O /tmp/openlist.tar.gz && \
mkdir -p /tmp/openlist && \
tar xvf /tmp/openlist.tar.gz -C /tmp/openlist && \
cp -r /tmp/openlist /app/

#RUN git clone https://github.com/justlovemaki/Gemini-CLI-2-API.git /app/Gemini-CLI-2-API


RUN caddy_url=$(curl -X 'GET' 'https://api.github.com/repos/caddyserver/caddy/releases' -H 'accept: application/json' | jq -r '.[0].assets[] | .browser_download_url | select(. | endswith("linux_amd64.tar.gz"))') && \
echo download caddy from $caddy_url && \ 
wget  $caddy_url -O /tmp/caddy.tar.gz && \
mkdir -p /tmp/caddy && \
tar xvf /tmp/caddy.tar.gz -C /tmp/caddy && \
cp -r /tmp/caddy /app/

RUN chmod -R 755 /app

# Add health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
  CMD curl -f http://localhost:7860/ || exit 1
  
# Start with sync
ENTRYPOINT ["/start.sh"]