Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

feat(template): added newapi

Seefs75d8cd12b46d
diff --git a/public/svgs/newapi.png b/public/svgs/newapi.png
new file mode 100644
index 0000000000..f62bfd57f1
Binary files /dev/null and b/public/svgs/newapi.png differ
diff --git a/templates/compose/newapi.yaml b/templates/compose/newapi.yaml
new file mode 100644
index 0000000000..039fc8645f
--- /dev/null
+++ b/templates/compose/newapi.yaml
@@ -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