Skip to content

Commit

Permalink
fix valkey stub
Browse files Browse the repository at this point in the history
add valkey support to InteractsWithDockerComposeServices.php file
  • Loading branch information
ariaieboy committed Dec 28, 2024
1 parent 968b278 commit f713fb4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/Console/Concerns/InteractsWithDockerComposeServices.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ trait InteractsWithDockerComposeServices
'mariadb',
'mongodb',
'redis',
'valkey',
'memcached',
'meilisearch',
'typesense',
Expand Down Expand Up @@ -93,7 +94,7 @@ protected function buildDockerCompose(array $services)
// Merge volumes...
collect($services)
->filter(function ($service) {
return in_array($service, ['mysql', 'pgsql', 'mariadb', 'mongodb', 'redis', 'meilisearch', 'typesense', 'minio']);
return in_array($service, ['mysql', 'pgsql', 'mariadb', 'mongodb', 'redis', 'valkey', 'meilisearch', 'typesense', 'minio']);
})->filter(function ($service) use ($compose) {
return ! array_key_exists($service, $compose['volumes'] ?? []);
})->each(function ($service) use (&$compose) {
Expand Down Expand Up @@ -164,6 +165,10 @@ protected function replaceEnvVariables(array $services)
$environment = str_replace('REDIS_HOST=127.0.0.1', 'REDIS_HOST=redis', $environment);
}

if (in_array('valkey',$services)){
$environment = str_replace('REDIS_HOST=127.0.0.1', 'REDIS_HOST=valkey', $environment);
}

if (in_array('mongodb', $services)) {
$environment .= "\nMONGODB_URI=mongodb://mongodb:27017";
$environment .= "\nMONGODB_DATABASE=laravel";
Expand Down
2 changes: 1 addition & 1 deletion stubs/valkey.stub
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
redis:
valkey:
image: 'valkey/valkey:alpine'
ports:
- '${FORWARD_VALKEY_PORT:-6379}:6379'
Expand Down

0 comments on commit f713fb4

Please sign in to comment.