Commit 63f00493 authored by Jon Pugh's avatar Jon Pugh

Make docker compose up command a constant, and add the "--force-recreate"...

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.
parent 6c5e22a8
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment