root ee73a1a26a
Some checks failed
Docker Build & Push SugarCRM 6.5 CE / build-and-push (push) Failing after 0s
fix: remove file volume mount (config_override.php)
2026-05-24 14:47:23 +02:00
2026-05-24 14:39:01 +02:00
2026-05-24 14:39:01 +02:00

SugarCRM 6.5.26 CE — Containerized Docker Environment

100% containerisierte SugarCRM Community Edition 6.5.26
Ein docker compose up -d — alles läuft: Apache/PHP 5.6 + MySQL 5.7 + REST API v4.1.

🚀 Quickstart

# 1. Clone
git clone https://git.kgessner.de/LuiiCode/sugar-crm.git
cd sugar-crm

# 2. Konfigurieren (Passwörter ändern!)
nano .env

# 3. Starten (All-in-One)
./start.sh
# ODER manuell:
docker compose up -d

# 4. Web-UI öffnen
# → http://localhost:2080
# Login: admin / admin123

🧪 API-Test-Scripte

Script Beschreibung
start.sh All-in-One: Starten + Warten + API-Test
test_api.py Basis-Test: Login, Module, CRUD
test_api_extended.py Erweiterter Test: Felder, Suche, Relationships, CRUD
test_seed.py Massendaten-Generator: Accounts, Contacts, Leads

Beispiele

# Schnelltest
python3 test_api.py

# Vollständiger API-Test
python3 test_api_extended.py

# 50 Test-Accounts + 50 Contacts + 50 Leads generieren
python3 test_seed.py --count 50

# Nur Daten zählen (keine neuen erstellen)
python3 test_seed.py --clean

🏗️ Architektur

┌─────────────────────────────────────────┐
│  Docker Compose                          │
│                                          │
│  ┌───────────────┐  ┌───────────────┐   │
│  │ SugarCRM 6.5  │  │   MySQL 5.7   │   │
│  │ Apache/PHP5.6 │  │    :3306      │   │
│  │    :2080      │◄─│               │   │
│  │               │  │               │   │
│  └───────────────┘  └───────────────┘   │
│                                          │
│  Data (volumes):                         │
│    sugarcrm_custom    → custom modules   │
│    sugarcrm_upload    → uploads          │
│    mysql_data         → DB Daten         │
└─────────────────────────────────────────┘

📦 Services

Service Image Port Beschreibung
sugarcrm Custom (PHP 5.6) 208080 SugarCRM 6.5.26 CE Web + API
db mysql:5.7 3306 MySQL Datenbank

⚙️ Konfiguration

Umgebungsvariablen (.env)

Variable Default Beschreibung
SUGARCRM_PORT 2080 Web-UI Port
MYSQL_PORT 3306 MySQL Port
MYSQL_ROOT_PASSWORD change_this… Sofort ändern!
MYSQL_DATABASE sugarcrm Datenbank-Name
MYSQL_USER sugarcrm DB-Nutzer
MYSQL_PASSWORD change_this… Sofort ändern!
SUGARCRM_ADMIN_USER admin Admin-Login
SUGARCRM_ADMIN_PASSWORD admin123 Admin-Passwort

⚠️ Sicherheit: .env vor erstem Start anpassen! Bei Änderung nach erstem Start: docker compose down -v && docker compose up -d

🔌 REST API v4.1

Endpoint: POST http://localhost:2080/service/v4_1/rest.php
Content-Type: application/x-www-form-urlencoded

Aufbau

method=login
input_type=JSON
response_type=JSON
rest_data={"user_auth":{"user_name":"admin","password":"0192023a7bbd73250516f069df18b500"}}

API Client (Python)

import hashlib, json, urllib.request

pwd_hash = hashlib.md5(b"admin123").hexdigest()
rest_data = json.dumps({
    "user_auth": {"user_name": "admin", "password": pwd_hash},
    "application_name": "My App"
})

body = urllib.parse.urlencode({
    "method": "login",
    "input_type": "JSON",
    "response_type": "JSON",
    "rest_data": rest_data
}).encode()

req = urllib.request.Request(
    "http://localhost:2080/service/v4_1/rest.php",
    data=body,
    headers={"Content-Type": "application/x-www-form-urlencoded"}
)
resp = json.loads(urllib.request.urlopen(req).read())
session_id = resp["id"]
print(f"Session: {session_id}")

Verfügbare Methoden

Methode Beschreibung
login Session starten
logout Session beenden
get_available_modules Alle Module (Accounts, Contacts, Leads...)
get_entry_list Einträge auslesen (mit Filter/Sortierung)
get_entry Einzelnen Eintrag per ID
set_entry Eintrag erstellen/aktualisieren
set_entries Mehrere Einträge erstellen
get_entries_count Anzahl Einträge zählen
search_by_module Globale Suche
get_module_fields Felddefinitionen eines Moduls
set_relationship Beziehungen verknüpfen
get_relationships Beziehungen auslesen

🛠️ Kommandos

# Start/Stop
docker compose up -d              # Starten
docker compose down               # Stoppen (Daten bleiben)
docker compose down -v            # Stoppen + ALLE DATEN LÖSCHEN

# Logs
docker compose logs -f sugarcrm   # SugarCRM-Logs
docker compose logs db            # MySQL-Logs

# Shell
docker compose exec sugarcrm bash # Container-Shell

# Backup
docker compose exec db mysqldump -u sugarcrm -p sugarcrm > backup.sql

🔧 CI/CD

Bei jedem Push auf main baut Gitea Actions automatisch:

  1. Docker-Image aus Dockerfile
  2. Push in die Gitea Container Registry: git.kgessner.de/luiicode/sugar-crm

Secrets erforderlich: REGISTRY_USER, REGISTRY_TOKEN (bereits gesetzt).

⚠️ Technische Pitfalls

Problem Fix
SourceForge ZIPs korrupt GitHub Mirror bklein01/sugarcrm verwendet
Debian Jessie EOL APT sources auf archive.debian.org umgebogen
Admin Wizard blockiert API installer_locked=true + adminwizard DB-Eintrag (init.sh)
config.php wird überschrieben init.sh macht idempotenten Restart
Kein mysqladmin im Container PHP-Socket-Check für DB-Wait-Loop

📋 Systemanforderungen

  • Docker 20.10+
  • Docker Compose v2
  • ~500 MB RAM (Apache + MySQL)
  • Ports 2080 und 3306 verfügbar

SugarCRM 6.5.26 CE | PHP 5.6 | MySQL 5.7 | REST v4.1 | AGPLv3

Description
Containerized SugarCRM/SuiteCRM environment with Docker Compose
Readme 78 KiB
Languages
Python 70.1%
Shell 24.4%
Dockerfile 5.5%