Docker Compose Installation Guide
This document provides detailed steps for deploying 88API using Docker Compose.
Prerequisites
- Docker and Docker Compose installed
- Recommended system: Linux (Ubuntu/CentOS/Debian, etc.)
Deploying with Docker Compose
Method 1: Using Git Clone (Recommended)
If you can access GitHub normally, this method is recommended. The project includes a complete docker-compose.yml configuration file:
# Download project source code
git clone https://github.com/QuantumNous/new-api.git
# Enter project directory
cd new-api
# Edit docker-compose.yml as needed
# Using nano editor
nano docker-compose.yml
# Or using vim editor
# vim docker-compose.ymlTip
The project's built-in docker-compose.yml file is already configured with
all necessary services (including MySQL and Redis). You only need to modify
parameters such as ports and passwords according to your needs.
Method 2: Manually Creating Configuration Files
If you cannot access GitHub or clone the repository, you can manually create configuration files:
- Create a directory for 88API deployment:
mkdir new-api
cd new-api-
Create a
docker-compose.ymlfile in this directoryYou can refer to the configuration examples in the Docker Compose Configuration Guide document and choose based on your needs:
- Production environment: Recommended to use complete configuration (including MySQL and Redis)
- Testing environment: Can use simplified configuration
-
Create the file using a text editor:
# Using nano editor
nano docker-compose.yml
# Or using vim editor
vim docker-compose.ymlCopy the selected configuration content to this file and customize it as needed.
Starting Services
After the configuration file is ready, whether you cloned via Git or created manually, you can use the following command to start services:
# Start services using Docker Compose
docker compose up -dThis command will automatically pull the required images and start services in the background.
Viewing Logs
- All services (follow)
docker compose logs -f- Logs of a specific service (examples:
new-api,mysql,redis)
docker compose logs -f new-api
docker compose logs -f mysql
docker compose logs -f redis- Show only the latest N lines
docker compose logs --tail=100 new-api- Show logs since a time window
docker compose logs --since=10m new-api- Include timestamps
docker compose logs -f -t new-api- Foreground mode debugging (stream logs while starting)
docker compose up
# Or start and follow a single service
docker compose up new-apiPress Ctrl+C to exit foreground mode (the service will stop). Use -d for background mode.
- List services/status
docker compose ps- Using container name to view logs (when
container_nameis set, e.g.,new-api)
docker logs -f new-apiStopping Services
# Stop services
docker compose downAccessing the System
After services start successfully, visit http://server-IP:3000. You will be guided to the initialization page to create the admin account and password (only required on first installation). After initialization, log in with the credentials you created.