Powered By InfancyIT
docker-compose up
Name | Conatiner | Version |
---|---|---|
nginx |
Nginx | 1.16.0 |
php7 |
PHP | 7.3 |
php5 |
PHP | 5.6 |
mysql |
MySQL | 5.7.22 |
phpmyadmin |
PhpMyAdmin | - |
- Clone/Copy the project folder inside
./src
- Run neccesary comands
composer update
cp .env.example .env
- If your native OS doesn't have
composer
orphp
you can run any command from inside container by selecting the proper container:docker-compose exec php7 {your_command}
docker-compose exec php5 {your_command}
docker-compose exec php7 bash -c "cd {folder_name} && composer update"
- Run neccesary comands
- Now we will create a
.conf
file for nginx.- Copy
./nginx/conf/sites-enabled/default.conf
to a newconf
file - Edit the followinng peroperty
server_name
online 3
port
online 4
- If you have a domain you have to select port 80
- If you don't have any domain you can listen to any port from 8000-8100 range
- You can listen multiple port for a single project also
root
online 6
. Here you have to put the path of theindex.php
/index.html
of the project and./src
should be replaced by/var/www/
- eg: For a traditional laravel project named
laravel_test_infancy
inside./src
, theroot
should be/var/www/laravel_test_infancy/public
- eg: For a traditional vuejs project named
vuejs_test_infancy
inside./src
, theroot
should be/var/www/vuejs_test_infancy/dist
- eg: For a traditional laravel project named
fastcgi_pass
online 22
- If you need
php 5.6
putphp5:9001
- If you need
php 7.3
putphp7:9000
- If you need
- Copy
- To create a database you can access
PhpMyAdmin
on port50
by default, alternatively you can create database viadocker-compose exec
from the root of this repository or manually putting database name ondocker-compose.yml
file - If your project has a
.env
update it as:DB_HOST=db
DB_PASSWORD={as per as this repo .env file}
- To run migration and/or necessary
artisan
command, you can:docker-compose exec php5 php {project_name}/artisan migrate --seed
docker-compose exec php7 php {project_name}/artisan migrate --seed
- To set the folder permissions for the container you should run:
- For laravel 4.2
docker-compose exec php5 chmod 777 -R {project_name}/app/storage
- For laravel 5.*/6.*
docker-compose exec php7 chmod 777 -R {project_name}/storage
- For laravel 4.2
- And finally:
docker-compose restart
- or
docker-compose down && docker-compose up