git clone https://github.com/darchoods/dh-api.git
cd dh-api
composer install
docker-compose up -d
The API container should be available on 127.0.0.1:8082
and MySQL should be available on port 127.0.0.1:33060
.
- Bash into api container before the startup process
docker-compose run --entrypoint /bin/bash api
- When the container is running you can attach to it using the following command
docker ps | egrep dh\-api\:latest | cut -f1 -d' ' | xargs -o -I % docker exec -it % /bin/bash
- Run the API without triggering migrations
docker-compose up -d mysql && docker-compose run -e AUTORUN_LARAVEL_MIGRATION=false api
Seeding
php artisan db:seed
Migrations
php artisan migrate --force --isolated
vendor/bin/phplint app tests
https://www.php-fig.org/psr/psr-12/
vendor/bin/phpcs
If the CS Checker comes back with errors that it can automaticlly fix, run
vendor/bin/phpcbf
and it should fix them.
- asdf - Version manager
Required for building php natively on Ubuntu 22.04 / Jammy
sudo apt install -y re2c plocate libcurl4 libcurl4-doc libcurl4-gnutls-dev libxml++2.6-dev libgd-dev libonig-dev libzip-dev