From cb2be973672a7911029fb54da6613ad2603c763a Mon Sep 17 00:00:00 2001 From: Patrick Hesselberg Date: Thu, 21 Mar 2024 02:23:02 +0100 Subject: [PATCH 1/2] add support for laravel/sail --- composer.json | 1 + composer.lock | 136 ++++++++++++++++++++++++++++++++++++++++++++- docker-compose.yml | 46 +++++++++++++++ 3 files changed, 182 insertions(+), 1 deletion(-) create mode 100644 docker-compose.yml diff --git a/composer.json b/composer.json index 6a9935144..7d39f2e3a 100644 --- a/composer.json +++ b/composer.json @@ -16,6 +16,7 @@ "larastan/larastan": "^2.9.2", "laravel/pint": "dev-feat/blade", "mockery/mockery": "^1.6.11", + "laravel/sail": "^1.29", "nunomaduro/collision": "^8.1.1", "pestphp/pest": "^2.34.4", "pestphp/pest-plugin-laravel": "^2.3.0", diff --git a/composer.lock b/composer.lock index 2e7f55db9..125758c7e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5321b72154e636109b4fb9aabda73a31", + "content-hash": "decd58b611201dd6441845616764f843", "packages": [ { "name": "brick/math", @@ -7030,6 +7030,69 @@ }, "time": "2024-03-20T19:13:48+00:00" }, + { + "name": "laravel/sail", + "version": "v1.29.1", + "source": { + "type": "git", + "url": "https://github.com/laravel/sail.git", + "reference": "8be4a31150eab3b46af11a2e7b2c4632eefaad7e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/sail/zipball/8be4a31150eab3b46af11a2e7b2c4632eefaad7e", + "reference": "8be4a31150eab3b46af11a2e7b2c4632eefaad7e", + "shasum": "" + }, + "require": { + "illuminate/console": "^9.52.16|^10.0|^11.0", + "illuminate/contracts": "^9.52.16|^10.0|^11.0", + "illuminate/support": "^9.52.16|^10.0|^11.0", + "php": "^8.0", + "symfony/console": "^6.0|^7.0", + "symfony/yaml": "^6.0|^7.0" + }, + "require-dev": { + "orchestra/testbench": "^7.0|^8.0|^9.0", + "phpstan/phpstan": "^1.10" + }, + "bin": [ + "bin/sail" + ], + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Laravel\\Sail\\SailServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Laravel\\Sail\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Docker files for running a basic Laravel application.", + "keywords": [ + "docker", + "laravel" + ], + "support": { + "issues": "https://github.com/laravel/sail/issues", + "source": "https://github.com/laravel/sail" + }, + "time": "2024-03-20T20:09:31+00:00" + }, { "name": "mockery/mockery", "version": "1.6.11", @@ -9848,6 +9911,77 @@ ], "time": "2024-02-09T16:08:40+00:00" }, + { + "name": "symfony/yaml", + "version": "v7.0.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "2d4fca631c00700597e9442a0b2451ce234513d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/2d4fca631c00700597e9442a0b2451ce234513d3", + "reference": "2d4fca631c00700597e9442a0b2451ce234513d3", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "symfony/console": "<6.4" + }, + "require-dev": { + "symfony/console": "^6.4|^7.0" + }, + "bin": [ + "Resources/bin/yaml-lint" + ], + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Loads and dumps YAML files", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/yaml/tree/v7.0.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-23T15:02:46+00:00" + }, { "name": "ta-tikoma/phpunit-architecture-test", "version": "0.8.4", diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..da019f7a3 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,46 @@ +services: + laravel.test: + build: + context: ./vendor/laravel/sail/runtimes/8.3 + dockerfile: Dockerfile + args: + WWWGROUP: '${WWWGROUP}' + image: sail-8.3/app + extra_hosts: + - 'host.docker.internal:host-gateway' + ports: + - '${APP_PORT:-80}:80' + - '${VITE_PORT:-5173}:${VITE_PORT:-5173}' + environment: + WWWUSER: '${WWWUSER}' + LARAVEL_SAIL: 1 + XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}' + XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}' + IGNITION_LOCAL_SITES_PATH: '${PWD}' + volumes: + - '.:/var/www/html' + networks: + - sail + depends_on: + - redis + redis: + image: 'redis:alpine' + ports: + - '${FORWARD_REDIS_PORT:-6379}:6379' + volumes: + - 'sail-redis:/data' + networks: + - sail + healthcheck: + test: + - CMD + - redis-cli + - ping + retries: 3 + timeout: 5s +networks: + sail: + driver: bridge +volumes: + sail-redis: + driver: local From d9875cebe4a0e664fd2b6efdcee04cdd4230c590 Mon Sep 17 00:00:00 2001 From: Patrick Hesselberg Date: Thu, 21 Mar 2024 21:10:29 +0100 Subject: [PATCH 2/2] remove redis service --- docker-compose.yml | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index da019f7a3..ddac7a5fb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,26 +21,7 @@ services: - '.:/var/www/html' networks: - sail - depends_on: - - redis - redis: - image: 'redis:alpine' - ports: - - '${FORWARD_REDIS_PORT:-6379}:6379' - volumes: - - 'sail-redis:/data' - networks: - - sail - healthcheck: - test: - - CMD - - redis-cli - - ping - retries: 3 - timeout: 5s + depends_on: { } networks: sail: driver: bridge -volumes: - sail-redis: - driver: local