Merge pull request #6753 from seefs001/next
feat(template): NewAPI template
This commit is contained in:
commit
f8f4c046a7
2 changed files with 56 additions and 0 deletions
BIN
public/svgs/newapi.png
Normal file
BIN
public/svgs/newapi.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
56
templates/compose/newapi.yaml
Normal file
56
templates/compose/newapi.yaml
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
# documentation: https://docs.newapi.pro/en/getting-started/
|
||||
# slogan: The next-generation LLM gateway and AI asset management system supports multiple languages.
|
||||
# category: api
|
||||
# tags: api, openai, llm, api-gateway, api-management
|
||||
# logo: svgs/newapi.png
|
||||
# port: 3000
|
||||
|
||||
services:
|
||||
new-api:
|
||||
image: calciumion/new-api:v0.9.2.0
|
||||
depends_on:
|
||||
postgresql:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
- SERVICE_URL_NEW_API_3000
|
||||
- SQL_DSN=postgres://$SERVICE_USER_POSTGRES:$SERVICE_PASSWORD_POSTGRES@postgresql:5432/${POSTGRES_DATABASE:-newapi}?sslmode=disable&TimeZone=${TZ:-Asia/Shanghai}
|
||||
- REDIS_CONN_STRING=redis://redis:6379
|
||||
- TZ=${TZ:-Asia/Shanghai}
|
||||
- SESSION_SECRET=$SERVICE_BASE64_64_SESSION_SECRET
|
||||
- ERROR_LOG_ENABLED=${ERROR_LOG_ENABLED:-true}
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD-SHELL
|
||||
- "wget -q -O - http://localhost:3000/api/status | grep -o '\"success\":\\s*true' | awk -F: '{print $2}'"
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
postgresql:
|
||||
image: postgres:16-alpine
|
||||
environment:
|
||||
- POSTGRES_USER=$SERVICE_USER_POSTGRES
|
||||
- POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRES
|
||||
- POSTGRES_DB=${POSTGRES_DATABASE:-newapi}
|
||||
volumes:
|
||||
- postgresql-data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD-SHELL
|
||||
- "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB:-newapi}"
|
||||
interval: 5s
|
||||
timeout: 10s
|
||||
retries: 20
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
volumes:
|
||||
- redis-data:/data
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD
|
||||
- redis-cli
|
||||
- PING
|
||||
interval: 5s
|
||||
timeout: 10s
|
||||
retries: 20
|
||||
Loading…
Reference in a new issue