Skip to content

Commit

Permalink
Merge pull request #321 from jolicode/worker
Browse files Browse the repository at this point in the history
fix some issues with worker profile
  • Loading branch information
pyrech authored Aug 26, 2024
2 parents f089b27 + dca655e commit fe9e7e3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
7 changes: 6 additions & 1 deletion .castor/docker.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function about(): void
if ("frontend-{$projectName}" === $router['service']) {
continue;
}
if (!preg_match('{^Host\\(`(?P<hosts>.*)`\\)$}', $router['rule'], $matches)) {
if (!preg_match('{^Host\(`(?P<hosts>.*)`\)$}', $router['rule'], $matches)) {
continue;
}
$hosts = explode('`) || Host(`', $matches['hosts']);
Expand Down Expand Up @@ -79,6 +79,11 @@ function build(
if ($profile) {
$command[] = '--profile';
$command[] = $profile;
} else {
$command[] = '--profile';
$command[] = 'default';
$command[] = '--profile';
$command[] = 'worker';
}

$command = [
Expand Down
2 changes: 1 addition & 1 deletion castor.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function start(): void
// workers_stop();
generate_certificates(force: false);
build();
up();
up(profiles: ['default']); // We can't start worker now, they are not installed
cache_clear();
install();
migrate();
Expand Down
3 changes: 1 addition & 2 deletions infrastructure/docker/docker-compose.worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ x-services-templates:
build:
context: services/php
target: worker
# Don't use depends_on, it does not work well when stopping containers
# with docker compose profiles
# Don't use depends_on, it does not work well with docker compose profiles
volumes:
- "../..:/var/www:cached"
profiles:
Expand Down

0 comments on commit fe9e7e3

Please sign in to comment.