summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Pugh2018-01-23 16:12:16 -0500
committerJon Pugh2018-01-23 16:12:16 -0500
commit63f00493aa4690faaca85c62b58f22c0b5fabcd0 (patch)
tree2bc347bf586537a34863e57e107bb12e7def8ffc
parent6c5e22a8e15387133ac0f69efd379edd620b32b7 (diff)
Make docker compose up command a constant, and add the "--force-recreate" flag. This way, if a host volume path was moved or deleted and recreated (as is with drush make) docker containers will be recreated.4.x
-rw-r--r--src/Service/Http/HttpApacheDockerService.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Service/Http/HttpApacheDockerService.php b/src/Service/Http/HttpApacheDockerService.php
index 01a7d6e..4a050f4 100644
--- a/src/Service/Http/HttpApacheDockerService.php
+++ b/src/Service/Http/HttpApacheDockerService.php
@@ -28,6 +28,8 @@ class HttpApacheDockerService extends HttpApacheService implements DockerService
const SERVICE_TYPE = 'apacheDocker';
const SERVICE_TYPE_NAME = 'Apache on Docker';
+ const DOCKER_COMPOSE_UP_COMMAND = 'docker-compose up -d --build --force-recreate';
+
/**
* @var string The name of this server's container.
@@ -228,10 +230,11 @@ YML;
});
// Run docker-compose up -d --build
+ $command = self::DOCKER_COMPOSE_UP_COMMAND;
$tasks['docker.compose.up'] = Provision::newTask()
- ->start("Running <info>docker-compose up -d --build</info> in <info>{$this->provider->server_config_path}</info> ...")
+ ->start("Running <info>{$command}</info> in <info>{$this->provider->server_config_path}</info> ...")
->execute(function() {
- return $this->provider->shell_exec('docker-compose up -d --build', NULL, 'exit');
+ return $this->provider->shell_exec(self::DOCKER_COMPOSE_UP_COMMAND, NULL, 'exit');
})
;
// Run docker-compose up -d --build