1 semaphore
Luca Matteo Spoljarevic edited this page 2026-02-27 21:45:51 +01:00

Semaphore

Semaphore is an open-source Ansible UI (by Ansible Semaphore). This setup runs Semaphore and a MySQL 8 database with Podman Compose, using environment variables for configuration.


What the compose file does

Service: semaphore_db

  • Image: mysql:8
  • Role: Database for Semaphore
  • Config: All from environment variables (MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE, MYSQL_RANDOM_ROOT_PASSWORD)
  • Volume: Named volume semaphore-db for /var/lib/mysql
  • Network: semaphore_network

Service: semaphore

  • Image: public.ecr.aws/semaphore/pro/server:v2.16.51
  • Port: 3010 → container 3000
  • Depends on: semaphore_db
  • Environment: Database connection, admin user, TOTP, optional Telegram alerts, Ansible options, etc. (see below)
  • Volumes: Named volumes for data, config, and temp
  • Network: semaphore_network

Volumes and network

  • Volumes: semaphore-db, semaphore-data, semaphore-config, semaphore-tmp
  • Network: semaphore_network (bridge)

Required environment variables

Create a .env file in the same directory as podman-compose.yml (do not commit real passwords). Example:

# Database
MYSQL_USER=semaphore
MYSQL_PASSWORD=your_db_password
MYSQL_DATABASE=semaphore
MYSQL_RANDOM_ROOT_PASSWORD=yes

SEMAPHORE_DB_DIALECT=mysql
SEMAPHORE_DB_HOST=semaphore_db
SEMAPHORE_DB_NAME=semaphore
SEMAPHORE_DB_USER=semaphore
SEMAPHORE_DB_PASS=your_db_password

# Admin user (first login)
SEMAPHORE_ADMIN=admin
SEMAPHORE_ADMIN_PASSWORD=admin_password
SEMAPHORE_ADMIN_NAME=Admin
SEMAPHORE_ADMIN_EMAIL=admin@example.com

# Optional
SEMAPHORE_SCHEDULE_TIMEZONE=Europe/Berlin
SEMAPHORE_TOTP_ENABLED=false
SEMAPHORE_AUTO_MIGRATE=true
ANSIBLE_HOST_KEY_CHECKING=false

Optional: Telegram alerts (SEMAPHORE_TELEGRAM_ALERT, SEMAPHORE_TELEGRAM_CHAT, SEMAPHORE_TELEGRAM_TOKEN).


Prerequisites

  • Podman and Podman Compose installed
  • .env file with the variables above (and matching DB credentials)

How to use

  1. Go to the project folder:

    cd semaphore
    
  2. Create .env with the required variables (see above).

  3. Start the stack:

    podman-compose up -d
    
  4. Open the UI:
    http://<your-host>:3010
    Log in with SEMAPHORE_ADMIN / SEMAPHORE_ADMIN_PASSWORD.

  5. Stop:

    podman-compose down
    

Data is kept in named volumes, so databases and config survive down unless you remove volumes.


Useful commands

Action Command
Start podman-compose up -d
Stop podman-compose down
Logs podman-compose logs -f
Restart podman-compose restart

Customization

  • Change the host port by editing 3010:3000 under semaphoreports.
  • Adjust TOTP, Telegram, or timezone in .env; no need to edit the compose file for those.