This project includes a docker container based on php-apache
image.
It is under development, So the source code is mounted from the host to the container. On the production environment you should remove these volumes.
Follow these steps to simply run the project.
Clone this repository to your local machine using the following command
git clone git@github.com:majidakbari/takeaway.git
Setting up the container (OS) level environment variables like $USER id WWW_DATA_USER_ID
. So every single file which is created or modified by container users will be owned by $USER because of user id mapping between the host and the containers.
cd /path-to-project
cp .env.example .env
vim .env
On the terminal and type the following command:
docker-compose up -d
Only the first time that you want to run the application, you need to execute the following command. It will install the dependencies, creates .env laravel file, generates the application key and changes required directory permissions.
docker-compose exec --user www-data app bootup
In the root of the project there is a postman collection which contains the API doc. Also you can find the API documentation on the following address.
To run tests, in the terminal type the following command:
docker-compose exec app vendor/bin/phpunit
app
php:7.3.5-apache