Skip to content
Snippets Groups Projects
Commit 1286d124 authored by jurgenhaas's avatar jurgenhaas
Browse files

#3 Simplify network handling

parent d3901749
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,7 @@ class Traefik {
else {
$fs->mkdir($traefikPath);
$traefik = [
'version' => '2',
'version' => '3',
'services' => [
'traefik' => [
'image' => 'traefik',
......@@ -80,12 +80,9 @@ class Traefik {
if (!in_array($this->name, $traefik['services']['traefik']['networks'])) {
$traefik['services']['traefik']['networks'][] = $this->name;
$traefik['networks'][$this->name] = [
'external' => [
'name' => $this->name . '_default',
],
'driver' => 'bridge',
];
file_put_contents($traefikFile, Yaml::dump($traefik, 9, 2));
exec('docker network create ' . $this->name . '_default');
exec('docker-compose -f ' . $traefikFile . ' --project-name traefik stop');
exec('docker-compose -f ' . $traefikFile . ' --project-name traefik up -d');
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment