Docker Compose Deployment

This document provides detailed steps for deploying Lamafa using Docker Compose.

Prerequisites

  • Docker and Docker Compose installed
  • Recommended OS: Linux (Ubuntu/CentOS/Debian, etc.)

Deploy with Docker Compose

Obtain the compose file

Get a configured docker-compose.yml (optionally including MySQL, Redis, and other dependencies) from your operations team or delivery package, then edit it in the deployment directory:

nano docker-compose.yml
# or: vim docker-compose.yml

Tip

The compose file usually includes required dependency services. Adjust ports, passwords, and other parameters for your environment.

Manually create the configuration file

If you need to author the compose file yourself:

  1. Create a directory for Lamafa deployment:
mkdir lamafa
  1. Create the docker-compose.yml file in this directory

    You can refer to the configuration examples in the Docker Compose Configuration Guide document and choose according to your needs:

    • For production environments, a complete configuration (including MySQL and Redis) is recommended.
    • For testing environments, a simplified configuration can be used.
  2. Use a text editor to create the file:

# Use nano editor
nano docker-compose.yml

# Or use vim editor
vim docker-compose.yml

Copy the selected configuration content into this file and customize it as needed.

Start Services

Once the configuration file is ready, whether you cloned it with Git or created it manually, you can use the following command to start the services:

# Start services using Docker Compose
docker compose up -d

This command will automatically pull the required images and start the services in the background.

View Logs

  • Real-time logs for all services
docker compose logs -f
  • Logs for a specific service (Examples: new-api, mysql, redis)
docker compose logs -f lamafa
docker compose logs -f mysql
docker compose logs -f redis
  • View only the last N lines
docker compose logs --tail=100 lamafa
  • View logs from a recent period
docker compose logs --since=10m lamafa
  • Show timestamps
docker compose logs -f -t lamafa
  • Foreground mode debugging (real-time log output with startup)
docker compose up
# Or only start and follow a specific service
docker compose up lamafa

Press Ctrl+C to exit foreground mode (this will stop the corresponding service). For background operation, use -d.

  • View service list/status
docker compose ps
  • View logs using container name (when container_name is set, e.g., new-api in the configuration)
docker logs -f lamafa

Stop Services

# Stop services
docker compose down

Access the System

After the services start successfully, accessing http://Server_IP:3000 will automatically redirect to the initialization page. Follow the on-screen instructions to manually set up the administrator account and password (only required for the first installation). After initialization, you can log in to the system using the administrator account you set.

How is this guide?