wwforonce commited on
Commit
84009f4
·
1 Parent(s): cf1a760

test gemini

Browse files
Files changed (3) hide show
  1. Caddyfile +10 -1
  2. Dockerfile +6 -0
  3. start_with_sync.sh +4 -1
Caddyfile CHANGED
@@ -1,3 +1,12 @@
1
  :7860 {
2
- reverse_proxy 127.0.0.1:5244
 
 
 
 
 
 
 
 
 
3
  }
 
1
  :7860 {
2
+
3
+ # Route requests to /GeminiCli2API and its subpaths to localhost
4
+ handle /GeminiCli2API* {
5
+ reverse_proxy localhost:3000
6
+ }
7
+
8
+ # Default route for other requests
9
+ # Other site configurations can go here
10
+ file_server
11
+
12
  }
Dockerfile CHANGED
@@ -8,6 +8,7 @@ RUN apt update && apt install -y \
8
  git-lfs \
9
  openssl \
10
  jq \
 
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
  # Install Python packages
@@ -38,6 +39,9 @@ mkdir -p /tmp/openlist && \
38
  tar xvf /tmp/openlist.tar.gz -C /tmp/openlist && \
39
  cp -r /tmp/openlist /app/
40
 
 
 
 
41
  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"))') && \
42
  echo download caddy from $caddy_url && \
43
  wget $caddy_url -O /tmp/caddy.tar.gz && \
@@ -45,6 +49,8 @@ mkdir -p /tmp/caddy && \
45
  tar xvf /tmp/caddy.tar.gz -C /tmp/caddy && \
46
  cp -r /tmp/caddy /app/
47
 
 
 
48
  # Add health check
49
  HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
50
  CMD curl -f http://localhost:7860/ || exit 1
 
8
  git-lfs \
9
  openssl \
10
  jq \
11
+ nodejs npm \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
  # Install Python packages
 
39
  tar xvf /tmp/openlist.tar.gz -C /tmp/openlist && \
40
  cp -r /tmp/openlist /app/
41
 
42
+ RUN git clone https://github.com/justlovemaki/Gemini-CLI-2-API.git /app/Gemini-CLI-2-API
43
+
44
+
45
  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"))') && \
46
  echo download caddy from $caddy_url && \
47
  wget $caddy_url -O /tmp/caddy.tar.gz && \
 
49
  tar xvf /tmp/caddy.tar.gz -C /tmp/caddy && \
50
  cp -r /tmp/caddy /app/
51
 
52
+ RUN chmod -R 755 /app
53
+
54
  # Add health check
55
  HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
56
  CMD curl -f http://localhost:7860/ || exit 1
start_with_sync.sh CHANGED
@@ -95,7 +95,10 @@ echo "Starting caddy..."
95
 
96
  # Start readeck in background
97
  #cp -r /app/openlist /tmp/
98
- cd /tmp/openlist && /app/openlist/openlist start &
 
 
 
99
  /app/caddy/caddy run /app/Caddyfile &
100
  TASK_PID=$!
101
 
 
95
 
96
  # Start readeck in background
97
  #cp -r /app/openlist /tmp/
98
+ #cd /tmp/openlist && /app/openlist/openlist start &
99
+ # npm install --prefix /app/Gemini-CLI-2-API
100
+ cd /app/Gemini-CLI-2-API&& npm install && node src/api-server.js &
101
+
102
  /app/caddy/caddy run /app/Caddyfile &
103
  TASK_PID=$!
104