Skip to content

Commit

Permalink
Merge pull request #99 from kirtangajjar/global-docker-compose
Browse files Browse the repository at this point in the history
Support global nginx-proxy container
  • Loading branch information
rahulsprajapati committed Aug 24, 2018
2 parents c18e965 + 655087d commit 41f49a7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
2 changes: 0 additions & 2 deletions src/Site_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,6 @@ private function create_site() {
$this->level = 1;
try {
EE\SiteUtils\create_site_root( $this->site['root'], $this->site['url'] );
$this->level = 2;
EE\SiteUtils\setup_site_network( $this->site['url'] );
$this->level = 3;
$this->configure_site_files();

Expand Down
13 changes: 11 additions & 2 deletions src/Site_Docker.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ public function generate_docker_compose_yml( array $filters = [] ) {
$base = [];

$restart_default = [ 'name' => 'always' ];
$network_default = [ 'name' => 'site-network' ];
$network_default = [
'net' => [
[ 'name' => 'site-network' ]
]
];

// nginx configuration.
$nginx['service_name'] = [ 'name' => 'nginx' ];
Expand Down Expand Up @@ -45,7 +49,12 @@ public function generate_docker_compose_yml( array $filters = [] ) {
'name' => 'io.easyengine.site=${VIRTUAL_HOST}',
],
];
$nginx['networks'] = $network_default;
$nginx['networks'] = [
'net' => [
$network_default,
[ 'name' => 'global-network' ],
]
];

$base[] = $nginx;

Expand Down
10 changes: 6 additions & 4 deletions templates/docker-compose.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
command: {{name}}
{{/command}}
{{#labels}}
labels:
labels:
{{#label}}
- "{{name}}"
{{/label}}
Expand All @@ -39,14 +39,16 @@ services:
{{/environment}}
{{#networks}}
networks:
{{#net}}
- {{name}}
{{/net}}
{{/networks}}

{{/services}}

{{#network}}
networks:
site-network:
global-network:
external:
name: ${VIRTUAL_HOST}
{{/network}}
name: ee-global-network
{{/network}}

0 comments on commit 41f49a7

Please sign in to comment.