cp .env.example .env
edit .env file and set SERVER_NAME
SERVER_NAME=consent.local
Also, you can config your db name and credentials.
docker-compose build --pull --no-cache
docker-compose up -d
Set your os always trust to below certificate
docker compose cp caddy:/data/caddy/certificates/local/consent.local/consent.local.crt /any/location/in/your/machine
See https://tosbourn.com/getting-os-x-to-trust-self-signed-ssl-certificates/
sudo echo '127.0.0.1 example.local' >> /etc/hosts
Generate key pair for your local We can automate this step only for dev envs because in live env we should never update our keypair
# Composer require is already done, composer.json updated
# docker-compose exec php composer require jwt-auth
# This step needs to be done for your local setup
docker-compose exec php sh -c '
set -e
apk add openssl
php bin/console lexik:jwt:generate-keypair
setfacl -R -m u:www-data:rX -m u:"$(whoami)":rwX config/jwt
setfacl -dR -m u:www-data:rX -m u:"$(whoami)":rwX config/jwt
'
cp phpunit.xml.dist .phpunit.xml
# These steps are already done, Just documented for the next services
docker-compose exec php composer require --dev alice
docker-compose exec php composer require --dev symfony/test-pack symfony/http-client justinrainbow/json-schema
Create db for first time
docker-compose exec php bin/console doctrine:database:create
After changing the mappings of your entities you can generate migrations and run them against your db
docker-compose exec php bin/console make:migration
docker-compose exec php bin/console doctrine:migrations:migrate
Also you can update db schema without generating migrations
docker-compose exec php bin/console doctrine:schema:update
Seed your local db to have some data, Write your fixtures in api/fixtures directory
docker-compose exec php bin/console hautelook:fixtures:load
docker-compose exec php bin/console doctrine:database:create --env=test
docker-compose exec php bin/console doctrine:migration:migrate --env=test
docker-compose exec php bin/phpunit
Doctrine Annotations for PHP 8.0 Read the official "Getting Started" guide.
Created by Kévin Dunglas. Commercial support available at Les-Tilleuls.coop.