], 'value' => '8.2']);
$form->addField('mysql', Checkbox::class, __('Serveur Mariadb') . ' (MySQL)', ['default' => true]);
$form->addField('redis', Checkbox::class, __('Serveur Redis'), ['default' => true]);
+ $form->addField('matomo', Checkbox::class, __('Serveur Matomo'), ['default' => true]);
return view('tools.form', ['form' => $form]);
}
$name = Str::slug($request->get('containername', 'containername'));
$variables = ['$name' => $name,
'$portadminer' => rand(10000, 60000),
+ '$portmatomo' => rand(10000, 60000),
+ '$matomodbpassword' => Str::random(16),
'$port' => rand(10000, 60000),
'$sshport' => rand(10000, 60000),
'$domain' => $request->get('domain', ''),
if ($request->get('mysql', true)) {
$compose[] = 'mysql';
}
+ if ($request->get('matomo', true)) {
+ $compose[] = 'matomo';
+ }
$compose[] = 'network';
$composeFileContent = '';
foreach ($compose as $item) {
$res = response()->download($tmpfile, $name . '.zip')->deleteFileAfterSend(true);
$notification = __('Le container web :name a été crée avec les informations suivantes', ['name' => $variables['$name']]) . "\n";
$infos = [
- 'URL' => 'https://' . $variables['$domain'] . '/',
- __('Hôte de base de données') => $variables['$name'] . '-mariadb',
- __('Nom de base de données') => $variables['$name'],
- __('Utilisateur de la base de données') => 'root',
- __('Mot de passe de la base de données') => $variables['$dbpassword'],
- 'Adminer' => 'https://adminer.' . $variables['$domain'] . '/',
- __('Serveur SSH/SFTP') => $variables['$domain'],
- __('Port') => $variables['$sshport'],
- __('Utilisateur') => $variables['$name'],
- __('Mot de passe') => $variables['$sshpassword'],
- ];
+ 'URL' => 'https://' . $variables['$domain'] . '/'];
+
+ if ($request->get('mysql', true)) {
+ $infos = array_merge($infos,
+ [
+ __('Hôte de base de données') => $variables['$name'] . '-mariadb',
+ __('Nom de base de données') => $variables['$name'],
+ __('Utilisateur de la base de données') => 'root',
+ __('Mot de passe de la base de données') => $variables['$dbpassword'],
+ 'Adminer' => 'https://adminer.' . $variables['$domain'] . '/',
+ __('Serveur SSH/SFTP') => $variables['$domain'],
+ __('Port') => $variables['$sshport'],
+ __('Utilisateur') => $variables['$name'],
+ __('Mot de passe') => $variables['$sshpassword'],
+ ]);
+ }
foreach ($infos as $k => $v) {
$notification .= '* ' . $k . ' : ' . $v . "\n";
}
--- /dev/null
+ matomo-db:
+ image: mariadb
+ container_name: $name-matomo-mariadb
+ command: --max-allowed-packet=64MB
+ restart: unless-stopped
+ volumes:
+ - ./matomo/database/data:/var/lib/mysql
+ environment:
+ MARIADB_ROOT_PASSWORD: "$matomodbpassword"
+ MARIADB_DATABASE: $name-matomo
+ MARIADB_AUTO_UPGRADE: 1
+ networks:
+ - $name
+
+ matomo:
+ image: 'matomo:latest'
+ container_name: $name-matomo
+ environment:
+ MATOMO_DATABASE_ADAPTER: mysql
+ MATOMO_DATABASE_USERNAME: root
+ MATOMO_DATABASE_PASSWORD: "$matomodbpassword"
+ MATOMO_DATABASE_DBNAME: $name-matomo
+ VIRTUAL_HOST: matomo.$domain
+ LETSENCRYPT_HOST: matomo.$domain
+ volumes:
+ - ./matomo/config:/var/www/html/config
+ - ./matomo/logs:/var/www/html/logs
+ - ./matomo/matomo:/var/www/html
+ - ./matomo/bin:/var/www/html/bin
+ restart: unless-stopped
+ ports:
+ - $portmatomo:80
+ networks:
+ - $name
+
+ matomo-mysqlbackup:
+ image: selim13/automysqlbackup
+ container_name: $name-matomo-automysqlbackup
+ volumes:
+ - "./matomo/database/backup:/backup"
+ environment:
+ USERNAME: root
+ PASSWORD: "$matomodbpassword"
+ DBHOST: $name-matomo-mariadb
+ DBEXCLUDE: "performance_schema information_schema"
+ CRON_SCHEDULE: "0 0 * * *"
+ EXTRA_OPTS: "--single-transaction"
+ networks:
+ - $name
+
+ matomo-redis:
+ image: redis
+ container_name: $name-matomo-redis
+
+ volumes:
+ - ./matomo/redis:/data
+ networks:
+ - $name