feat(template): added newapi

This commit is contained in:
Seefs 2025-10-02 16:09:07 +08:00
parent da6c7ed7d5
commit 75d8cd12b4
2 changed files with 56 additions and 0 deletions

BIN
public/svgs/newapi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View file

@ -0,0 +1,56 @@
# documentation: https://github.com/Calcium-Ion/new-api
# 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:latest
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