Base Website with Slim Framework and Api JWT Authentication on Docker with Php 7.3.7 Mysql Apache Phpmyadmin and XDebug
Install Certutil
- sudo apt install libnss3-tools -y
Install mkcert
- wget https://github.com/FiloSottile/mkcert/releases/download/v1.1.2/mkcert-v1.1.2-linux-amd64
- mv mkcert-v1.1.2-linux-amd64 mkcert
- chmod +x mkcert
- sudo cp mkcert /usr/local/bin/
Generate Local CA
- mkcert -install
Generate Local SSL Certificates
- sudo mkcert example.com '*.example.com' localhost 127.0.0.1 ::1
Copy the certificate example.com+4.pem and key example.com+4-key.pem into folder .docker/apache of your project.
Rename these files to server.pem and server-key.pem and give the permission 644.
- sudo chmod 644 server.pem
- sudo chmod 644 server-key.pem
References
Before the command below make sure if you have a permission 755 on the storage folder
- docker-compose up -d
- docker exec -it apache-srv composer install
Before you RUN phinx migrate to populate database Copy the .env-example => .env and configure fields Log in postgres-server and create website and tests databases.
and next RUN the commands below
- docker exec -it apache-srv vendor/bin/phinx migrate
- docker exec -it apache-srv vendor/bin/phinx seed:run
- docker exec -it apache-srv vendor/bin/phpunit