new-api,基于one-api

部署

docker

1
docker run --name new-api -d --restart always -p 3000:3000 -e TZ=Asia/Shanghai -v /home/ubuntu/data/new-api:/data calciumion/new-api:latest

docker-compose

1
sudo mkdir -p /opt/new-api
1
2
cd /opt/new-api
sudo vim /opt/new-api/docker-compose.yml
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
version: '3.9'
services:
    new-api:
        image: 'calciumion/new-api:latest'
        volumes:
            - './data:/data'
        environment:
            - TZ=Asia/Shanghai
        ports:
            - '3000:3000'
        restart: unless-stopped
        container_name: new-api

启动

1
sudo docker compose up

反向代理

Nginx

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
server {
    listen 80;
    server_name domain.com;

    location / {
        proxy_pass http://127.0.0.1:3000;  # 替换为你的应用程序地址
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}
使用 Hugo 构建
主题 StackJimmy 设计