nyanya commited on
Commit
28b39b5
1 Parent(s): 2768617

add from one-api

Browse files
Files changed (4) hide show
  1. Dockerfile +1 -0
  2. nginx.conf +15 -1
  3. on_startup.sh +11 -11
  4. start_server.sh +1 -1
Dockerfile CHANGED
@@ -1,4 +1,5 @@
1
  FROM phusion/baseimage:master
 
2
 
3
  ENV DEBIAN_FRONTEND=noninteractive \
4
  TZ=Asia/Jakarta
 
1
  FROM phusion/baseimage:master
2
+ FROM ckt1031/one-api-en:latest
3
 
4
  ENV DEBIAN_FRONTEND=noninteractive \
5
  TZ=Asia/Jakarta
nginx.conf CHANGED
@@ -16,7 +16,21 @@ server {
16
  proxy_cache_bypass $http_upgrade;
17
  proxy_read_timeout 86400;
18
  proxy_redirect off;
19
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
  location /one/ {
22
  client_max_body_size 64m;
 
16
  proxy_cache_bypass $http_upgrade;
17
  proxy_read_timeout 86400;
18
  proxy_redirect off;
19
+ }
20
+
21
+ location /code/ {
22
+ # Serve GRADIO 7860
23
+ proxy_pass http://localhost:8000;
24
+ proxy_http_version 1.1;
25
+ proxy_set_header Upgrade $http_upgrade;
26
+ proxy_set_header Connection 'upgrade';
27
+ proxy_set_header Host $host;
28
+ proxy_set_header X-Real-IP $remote_addr;
29
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
30
+ proxy_cache_bypass $http_upgrade;
31
+ proxy_read_timeout 86400;
32
+ proxy_redirect off;
33
+ }
34
 
35
  location /one/ {
36
  client_max_body_size 64m;
on_startup.sh CHANGED
@@ -8,17 +8,17 @@
8
  git clone https://github.com/ckt1031/one-api/
9
 
10
  # Build the frontend
11
- cd one-api/web
12
- npm install
13
- npm run build
14
 
15
  # Build the backend
16
- cd ..
17
- export GO111MODULE=on
18
- export CGO_ENABLED=1
19
- export GOOS=linux
20
- python ./i18n/translate.py --repository_path . --json_file_path ./i18n/en.json
21
- go mod download
22
- go build -ldflags "-s -w -X 'one-api/common.Version=$(cat VERSION)' -extldflags '-static'" -o one-api
23
- chmod u+x one-api
24
  #./one-api --port 3000 --log-dir ./logs
 
8
  git clone https://github.com/ckt1031/one-api/
9
 
10
  # Build the frontend
11
+ #cd one-api/web
12
+ #npm install
13
+ #npm run build
14
 
15
  # Build the backend
16
+ #cd ..
17
+ #export GO111MODULE=on
18
+ #export CGO_ENABLED=1
19
+ #export GOOS=linux
20
+ #python ./i18n/translate.py --repository_path . --json_file_path ./i18n/en.json
21
+ #go mod download
22
+ #go build -ldflags "-s -w -X 'one-api/common.Version=$(cat VERSION)' -extldflags '-static'" -o one-api
23
+ #chmod u+x one-api
24
  #./one-api --port 3000 --log-dir ./logs
start_server.sh CHANGED
@@ -5,7 +5,7 @@ service nginx start
5
  echo "Starting VSCode Server..."
6
  /app/openvscode-server/bin/openvscode-server --host 0.0.0.0 --port 7860 --without-connection-token "${@}" &
7
 
8
- /home/user/one-api/one-api --port 3000 --log-dir ./logs &
9
 
10
  #echo "Starting Code Tunnel..."
11
  #/usr/bin/code tunnel --accept-server-license-terms &
 
5
  echo "Starting VSCode Server..."
6
  /app/openvscode-server/bin/openvscode-server --host 0.0.0.0 --port 7860 --without-connection-token "${@}" &
7
 
8
+ #/home/user/one-api/one-api --port 3000 --log-dir ./logs &
9
 
10
  #echo "Starting Code Tunnel..."
11
  #/usr/bin/code tunnel --accept-server-license-terms &