Developer Installation¶
With SeAT 4, starting with Docker build 4.1.0, spawning a development environment has been made easier. You can use the same image as of production environment - either you're working on core packages or third party ones.
General¶
First, start with standard installation to get a working environment.
The official docker-compose wrapper is shipped with a packages
directory.
It is mounted readonly, and you can store your development sources in it.
To make things easier, we recommend you keep vendor path convention to split your sources across every single package you want to play with.
Overrider¶
The image has been designed to look for a file called override.json
inside packages
directory.
When it is found, it will be merged together with standard composer.json
file from eveseat/seat
package.
It's designed to override both autoload
and providers
.
Here is a complete override.json
structure:
{
"autoload": {
"namespace_to_load\\": "packages/sources_path"
},
"providers": [
"FQCN\\Provider"
]
}
An override can have either autoload, providers or even both property.
Do not forget to escape \
in order to get a valid json file.
When your container will start, mapping from autoload
property in your override.json
file will be merged with autoload-dev
property from official composer.json
.
Tips
- If you need access the console of any container, access it via
docker exec seat-web sh
whereseat-web
is the name of the target container. - You can execute
artisan
commands from outside of docker withdocker exec seat-web php artisan <command>
Teach things by example¶
As an example, let's say I want to make a new feature in web core package, I'll spawn an eveseat
directory at root packages
directory, followed by a clone from eveseat/web
git repository.
Last but not least, I'll create an override.json
file to inform SeAT there are developer things to load.
- Create vendor directory into
packages
directorymkdir packages/eveseat
- Cloning core web package into
packages/eveseat/web
directorygit clone https://github.com/eveseat/web.git packages/eveseat/web
- Create an
override.json
to use custom web sources
cat > packages/override.json << EOL
{
"autoload": {
"Seat\\Web\\": "packages/eveseat/web/src/"
}
}
EOL
Tips
If you're working with Windows, prefer to store your files in wsl layer rather than Windows directory. Both work, however, you'll get better performances!