File size: 1,732 Bytes
8059bf0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Sub2API Docker Image

Sub2API is an AI API Gateway Platform for distributing and managing AI product subscription API quotas.

## Quick Start

```bash

docker run -d \

  --name sub2api \

  -p 8080:8080 \

  -e DATABASE_URL="postgres://user:pass@host:5432/sub2api" \

  -e REDIS_URL="redis://host:6379" \

  weishaw/sub2api:latest

```

## Docker Compose

```yaml

version: '3.8'



services:

  sub2api:

    image: weishaw/sub2api:latest

    ports:

      - "8080:8080"

    environment:

      - DATABASE_URL=postgres://postgres:postgres@db:5432/sub2api?sslmode=disable

      - REDIS_URL=redis://redis:6379

    depends_on:

      - db

      - redis



  db:

    image: postgres:15-alpine

    environment:

      - POSTGRES_USER=postgres

      - POSTGRES_PASSWORD=postgres

      - POSTGRES_DB=sub2api

    volumes:

      - postgres_data:/var/lib/postgresql/data



  redis:

    image: redis:7-alpine

    volumes:

      - redis_data:/data



volumes:

  postgres_data:

  redis_data:

```

## Environment Variables

| Variable | Description | Required | Default |
|----------|-------------|----------|---------|
| `DATABASE_URL` | PostgreSQL connection string | Yes | - |
| `REDIS_URL` | Redis connection string | Yes | - |
| `PORT` | Server port | No | `8080` |
| `GIN_MODE` | Gin framework mode (`debug`/`release`) | No | `release` |

## Supported Architectures

- `linux/amd64`
- `linux/arm64`

## Tags

- `latest` - Latest stable release
- `x.y.z` - Specific version
- `x.y` - Latest patch of minor version
- `x` - Latest minor of major version

## Links

- [GitHub Repository](https://github.com/weishaw/sub2api)
- [Documentation](https://github.com/weishaw/sub2api#readme)