|
| 1 | +--- |
| 2 | +title: Docker auf Debian GNU/Linux |
| 3 | +description: i-doit als Docker-Container auf Debian GNU/Linux installieren |
| 4 | +icon: material/debian |
| 5 | +status: |
| 6 | +lang: de |
| 7 | +--- |
| 8 | + |
| 9 | +!!! note "Getestet mit i-doit **38** und **Debian 13 Trixie**" |
| 10 | + |
| 11 | +Diese Anleitung beschreibt die manuelle Installation von i-doit als Docker-Container auf Debian GNU/Linux. |
| 12 | + |
| 13 | +## Systemvoraussetzungen |
| 14 | + |
| 15 | +Es gelten die allgemeinen [Systemvoraussetzungen](../../systemvoraussetzungen.md). Zusätzlich werden benötigt: |
| 16 | + |
| 17 | +- **Docker** ≥ 24 mit Compose-Plugin |
| 18 | +- Root-Rechte oder `sudo`-Zugang |
| 19 | +- Internetverbindung |
| 20 | + |
| 21 | +## Docker installieren |
| 22 | + |
| 23 | +Zunächst werden die benötigten Basispakete installiert: |
| 24 | +<!-- cSpell:disable --> |
| 25 | +```sh |
| 26 | +sudo apt-get update |
| 27 | +sudo apt-get install -y ca-certificates curl gnupg unzip wget jq default-mysql-client |
| 28 | +``` |
| 29 | +<!-- cSpell:enable --> |
| 30 | +Docker wird über das offizielle Installationsscript eingerichtet: |
| 31 | +<!-- cSpell:disable --> |
| 32 | +```sh |
| 33 | +curl -fsSL https://get.docker.com -o get-docker.sh |
| 34 | +sudo sh get-docker.sh |
| 35 | +sudo apt-get install -y docker-compose-plugin |
| 36 | +``` |
| 37 | +<!-- cSpell:enable --> |
| 38 | + |
| 39 | +## Projektstruktur anlegen |
| 40 | + |
| 41 | +Ein Verzeichnis für den i-doit Docker-Setup wird erstellt: |
| 42 | +<!-- cSpell:disable --> |
| 43 | +```sh |
| 44 | +sudo mkdir -p /opt/idoit-docker/{config,html,mysql_data} |
| 45 | +cd /opt/idoit-docker |
| 46 | +``` |
| 47 | +<!-- cSpell:enable --> |
| 48 | + |
| 49 | +## Dockerfile erstellen |
| 50 | + |
| 51 | +Das Dockerfile baut ein PHP-Apache-Image mit allen für i-doit benötigten PHP-Extensions: |
| 52 | +<!-- cSpell:disable --> |
| 53 | +```sh |
| 54 | +sudo nano /opt/idoit-docker/Dockerfile |
| 55 | +``` |
| 56 | +<!-- cSpell:enable --> |
| 57 | +<!-- cSpell:disable --> |
| 58 | +```dockerfile |
| 59 | +FROM php:8.2-apache |
| 60 | +RUN apt-get update && apt-get install -y \ |
| 61 | + libpng-dev libjpeg-dev libldap2-dev libpq-dev libzip-dev \ |
| 62 | + libmemcached-dev zlib1g-dev libxml2-dev default-mysql-client cron \ |
| 63 | + && rm -rf /var/lib/apt/lists/* |
| 64 | +RUN docker-php-ext-configure gd --with-jpeg \ |
| 65 | + && docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \ |
| 66 | + && docker-php-ext-install -j$(nproc) bcmath gd pdo pdo_mysql pdo_pgsql ldap soap xml zip mysqli opcache sockets |
| 67 | +RUN pecl install memcached && docker-php-ext-enable memcached |
| 68 | +RUN a2enmod rewrite headers |
| 69 | +WORKDIR /var/www/html |
| 70 | +``` |
| 71 | +<!-- cSpell:enable --> |
| 72 | + |
| 73 | +## Konfigurationsdateien erstellen |
| 74 | + |
| 75 | +### PHP-Konfiguration |
| 76 | +<!-- cSpell:disable --> |
| 77 | +```sh |
| 78 | +sudo nano /opt/idoit-docker/config/php.ini |
| 79 | +``` |
| 80 | +<!-- cSpell:enable --> |
| 81 | +<!-- cSpell:disable --> |
| 82 | +```ini |
| 83 | +allow_url_fopen = Yes |
| 84 | +file_uploads = On |
| 85 | +max_execution_time = 300 |
| 86 | +max_input_vars = 10000 |
| 87 | +memory_limit = 256M |
| 88 | +post_max_size = 128M |
| 89 | +short_open_tag = On |
| 90 | +upload_max_filesize = 128M |
| 91 | +date.timezone = Europe/Berlin |
| 92 | +session.gc_maxlifetime = 604800 |
| 93 | +``` |
| 94 | +<!-- cSpell:enable --> |
| 95 | + |
| 96 | +!!! tip "Das `memory_limit` kann bei Bedarf auf `512M` erhöht werden, z.B. bei größeren Reports oder vielen Objekten." |
| 97 | + |
| 98 | +### MariaDB-Konfiguration |
| 99 | +<!-- cSpell:disable --> |
| 100 | +```sh |
| 101 | +sudo nano /opt/idoit-docker/config/mariadb.cnf |
| 102 | +``` |
| 103 | +<!-- cSpell:enable --> |
| 104 | +<!-- cSpell:disable --> |
| 105 | +```ini |
| 106 | +[mysqld] |
| 107 | +innodb_buffer_pool_size = 1G |
| 108 | +innodb_log_file_size = 512M |
| 109 | +max_allowed_packet = 128M |
| 110 | +max_connections = 200 |
| 111 | +innodb_file_per_table = 1 |
| 112 | +innodb_flush_log_at_trx_commit = 1 |
| 113 | +tmp_table_size = 32M |
| 114 | +max_heap_table_size = 32M |
| 115 | +sort_buffer_size = 262144 |
| 116 | +join_buffer_size = 262144 |
| 117 | +innodb_sort_buffer_size = 64M |
| 118 | +``` |
| 119 | +<!-- cSpell:enable --> |
| 120 | + |
| 121 | +### Cron-Konfiguration |
| 122 | + |
| 123 | +Der Cron-Container führt die i-doit-Hintergrundaufgaben aus: |
| 124 | +<!-- cSpell:disable --> |
| 125 | +```sh |
| 126 | +sudo nano /opt/idoit-docker/config/idoit-cron |
| 127 | +``` |
| 128 | +<!-- cSpell:enable --> |
| 129 | +<!-- cSpell:disable --> |
| 130 | +``` |
| 131 | +* * * * * www-data php /var/www/html/console.php controller-worker -v >> /var/log/apache2/cron.log 2>&1 |
| 132 | +``` |
| 133 | +<!-- cSpell:enable --> |
| 134 | + |
| 135 | +## docker-compose.yml erstellen |
| 136 | +<!-- cSpell:disable --> |
| 137 | +```sh |
| 138 | +sudo nano /opt/idoit-docker/docker-compose.yml |
| 139 | +``` |
| 140 | +<!-- cSpell:enable --> |
| 141 | +<!-- cSpell:disable --> |
| 142 | +```yaml |
| 143 | +services: |
| 144 | + idoit-db: |
| 145 | + image: mariadb:10.6 |
| 146 | + restart: always |
| 147 | + environment: |
| 148 | + MARIADB_ROOT_PASSWORD: idoit_secure_password |
| 149 | + MARIADB_ROOT_HOST: "%" |
| 150 | + volumes: |
| 151 | + - ./mysql_data:/var/lib/mysql |
| 152 | + - ./config/mariadb.cnf:/etc/mysql/conf.d/idoit.cnf:ro |
| 153 | + |
| 154 | + idoit-web: |
| 155 | + build: . |
| 156 | + restart: always |
| 157 | + ports: |
| 158 | + - "80:80" |
| 159 | + volumes: |
| 160 | + - ./html:/var/www/html |
| 161 | + - ./config/php.ini:/usr/local/etc/php/conf.d/idoit.ini:ro |
| 162 | + environment: |
| 163 | + - DB_HOST=idoit-db |
| 164 | + depends_on: |
| 165 | + - idoit-db |
| 166 | + |
| 167 | + idoit-cron: |
| 168 | + build: . |
| 169 | + restart: always |
| 170 | + command: ["cron", "-f"] |
| 171 | + volumes: |
| 172 | + - ./html:/var/www/html |
| 173 | + - ./config/php.ini:/usr/local/etc/php/conf.d/idoit.ini:ro |
| 174 | + - ./config/idoit-cron:/etc/cron.d/idoit:ro |
| 175 | + depends_on: |
| 176 | + - idoit-db |
| 177 | +``` |
| 178 | +<!-- cSpell:enable --> |
| 179 | +
|
| 180 | +!!! warning "Das Datenbankpasswort `idoit_secure_password` sollte durch ein sicheres, individuelles Passwort ersetzt werden." |
| 181 | + |
| 182 | +## i-doit herunterladen |
| 183 | + |
| 184 | +i-doit wird vom offiziellen Update-Feed heruntergeladen und in das HTML-Verzeichnis entpackt: |
| 185 | +<!-- cSpell:disable --> |
| 186 | +```sh |
| 187 | +cd /opt/idoit-docker |
| 188 | +wget -q -O updates.xml https://i-doit.com/updates.xml |
| 189 | +DOWNLOAD_URL=$(grep -oP "(?<=<filename>)[^<]+" updates.xml | tail -n 1) |
| 190 | +DOWNLOAD_URL=${DOWNLOAD_URL/-update.zip/.zip} |
| 191 | +wget -O idoit.zip "$DOWNLOAD_URL" |
| 192 | +sudo unzip -q -o idoit.zip -d html/ |
| 193 | +rm idoit.zip updates.xml |
| 194 | +sudo chown -R 33:33 html/ |
| 195 | +sudo find html/ -type d -exec chmod 775 {} \; |
| 196 | +sudo find html/ -type f -exec chmod 664 {} \; |
| 197 | +``` |
| 198 | +<!-- cSpell:enable --> |
| 199 | + |
| 200 | +## Container starten |
| 201 | +<!-- cSpell:disable --> |
| 202 | +```sh |
| 203 | +cd /opt/idoit-docker |
| 204 | +sudo docker compose build --no-cache |
| 205 | +sudo docker compose up -d |
| 206 | +``` |
| 207 | +<!-- cSpell:enable --> |
| 208 | + |
| 209 | +Der erste Start dauert einige Minuten, da das PHP-Image gebaut und alle Extensions kompiliert werden. |
| 210 | + |
| 211 | +## i-doit einrichten |
| 212 | + |
| 213 | +Sobald die Datenbank bereit ist, wird i-doit über die Kommandozeile eingerichtet: |
| 214 | +<!-- cSpell:disable --> |
| 215 | +```sh |
| 216 | +# Warten bis die Datenbank bereit ist |
| 217 | +until sudo docker compose exec -T idoit-web php -r "try { new PDO('mysql:host=idoit-db', 'root', 'idoit_secure_password'); exit(0); } catch (PDOException \$e) { exit(1); }" 2>/dev/null; do |
| 218 | + echo "Warte auf Datenbank..." |
| 219 | + sleep 3 |
| 220 | +done |
| 221 | +
|
| 222 | +# i-doit System installieren |
| 223 | +sudo docker compose exec -T --user 33 idoit-web php console.php install \ |
| 224 | + -u root -p "idoit_secure_password" --host="idoit-db" -d idoit_system \ |
| 225 | + -U idoit -P "idoit_secure_password" --admin-password "admin123" -n |
| 226 | +
|
| 227 | +# Mandant anlegen |
| 228 | +sudo docker compose exec -T --user 33 idoit-web php console.php tenant-create \ |
| 229 | + -u root -p "idoit_secure_password" -U idoit -P "idoit_secure_password" \ |
| 230 | + -d idoit_data -t "My Company" -n |
| 231 | +``` |
| 232 | +<!-- cSpell:enable --> |
| 233 | + |
| 234 | +Nach der Installation ist i-doit unter `http://<IP-Adresse>/` erreichbar. |
| 235 | + |
| 236 | +!!! success "Standardzugänge nach der Installation" |
| 237 | + - **i-doit**: Benutzer `admin`, Passwort `admin` |
| 238 | + - **Admin Center**: Benutzer `admin`, Passwort `admin123` |
| 239 | + |
| 240 | +## Nächster Schritt |
| 241 | + |
| 242 | +Die Installation ist abgeschlossen. Im nächsten Schritt eine Lizenz einspielen und die ersten Einstellungen vornehmen: |
| 243 | + |
| 244 | +[Weiter zu **Setup**](../manuelle-installation/setup.md) |
0 commit comments