Skip to content

Docker Deployment

Docker deployment is the recommended method, supporting all platforms with simplicity and speed.

Step 1: Install Docker

If you haven't installed Docker yet:

TIP

We recommend using Docker Compose for container management, making configuration and upgrades easier.

Step 2: Deploy with Docker Compose

Create a docker-compose.yml file:

yaml
version: '3.8'
services:
  any-api:
    image: calciumion/any-api:latest
    container_name: any-api
    restart: always
    ports:
      - "3000:3000"
    volumes:
      - ./data:/data
    environment:
      - SQL_DSN=  # Leave empty to use SQLite
      - REDIS_CONN_STRING=  # Leave empty to use in-memory cache

Start the service:

bash
docker compose up -d

Step 3: Access the Admin Dashboard

After deployment, visit http://localhost:3000 to open the admin dashboard.

Default admin credentials:

  • Username: root
  • Password: 123456

WARNING

Please change the default password immediately after your first login!

Step 4: Create an API Key

  1. Log in to the admin dashboard
  2. Go to the "Tokens" page
  3. Click "Add Token"
  4. Set a name and quota, then save
  5. Copy the generated API key

Environment Variables

Common environment variables:

VariableDescriptionDefault
SQL_DSNDatabase connection string (empty = SQLite)Empty
REDIS_CONN_STRINGRedis connection string (empty = in-memory cache)Empty
SESSION_SECRETSession encryption keyRandom
SYNC_FREQUENCYBalance sync frequency (minutes)60

Upgrading

bash
docker compose pull
docker compose up -d

Data is automatically preserved in the ./data directory.

API PLAT