Skip to content

Commit

Permalink
fix feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
joelwurtz committed May 3, 2024
1 parent 91c5947 commit 334ab81
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 22 deletions.
40 changes: 20 additions & 20 deletions .castor/docker.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ function workers_stop(): void
function push(): void
{
// Generate bake file
$composeFile = context()->data['docker_compose_files'];
$composeFile = variable('docker_compose_files');
$composeFile[] = 'docker-compose.builder.yml';

$targets = [];
Expand Down Expand Up @@ -355,32 +355,32 @@ function push(): void
$registry = variable('registry');

$content = sprintf(<<<EOHCL
group "default" {
targets = [%s]
}
EOHCL
group "default" {
targets = [%s]
}
EOHCL
, implode(', ', array_map(fn ($target) => sprintf('"%s"', $target['target']), $targets)));


foreach ($targets as $target) {
$reference = str_replace('${REGISTRY:-}', $registry ?? '', $target['reference'] ?? '');

$content .= sprintf(<<<EOHCL
target "%s" {
context = "infrastructure/docker/%s"
dockerfile = "%s"
cache-from = ["%s"]
cache-to = ["type=%s,ref=%s,mode=max"]
target = "%s"
args = {
PHP_VERSION = "%s"
}
}
EOHCL
target "%s" {
context = "infrastructure/docker/%s"
dockerfile = "%s"
cache-from = ["%s"]
cache-to = ["type=%s,ref=%s,mode=max"]
target = "%s"
args = {
PHP_VERSION = "%s"
}
}
EOHCL
, $target['target'], $target['context'], $target['dockerfile'], $reference, $target['type'], $reference, $target['target'], variable('php_version'));
}

Expand Down
2 changes: 0 additions & 2 deletions infrastructure/docker/docker-compose.worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ x-services-templates:
volumes:
- "../..:/var/www:cached"
- "../../.home:/home/app:cached"
labels:
- "docker-starter.worker.${PROJECT_NAME}=true"
environment:
- HOME=/home/app
profiles:
Expand Down

0 comments on commit 334ab81

Please sign in to comment.