- nginx:latest
- MySQL
- PHP 7.3
- PhpMyAdmin
- Mailcatcher
- Elasticsearch
- RabbitMQ
- Redis
Repository provides two docker-compose files. One for development environment and one for production. In the root of repository located vca.bash script which allow to control docker containers such as: start, build, down and some actions inside them as composer update/install, etc.
Nginx config is located at Nginx directory and Nginx's log files there too in directory logs.
php.ini file is located under php-fpm directory. Also it's available to modify PHP container's Dockerfile.
- Content
- Installation
- One ring for rule... | One script for control...
- PHPUnit
- Control status of Docker-compose containers
- It's bigger inside than outside | Inside container
- Composer
- Plan of improvements
- Authors
- First go to the root folder of project which you'll be dockerized
- Open terminal there and run command:
vasyltarasov@Vasyls-MBP ~ % git clone [email protected]:etvsyaka/docker.git
Cloning into 'docker'...
........................
vasyltarasov@Vasyls-MBP ~ % cd docker/
vasyltarasov@Vasyls-MBP ~ % ./bin/containers.bash build
vasyltarasov@Vasyls-MBP ~ % ./bin/containers.bash start
vasyltarasov@Vasyls-MBP ~ % ./bin/containers.bash bash
- After containers was builded and runed we need to edit /etc/hosts file
sudo vim /etc/hosts
# Add after first lines this:
127.0.0.1 symfony.loc, www.symfony.loc
- Now you can access your app via address http://symfony.loc/
- PhpMyAdmin locates at http://localhost:801
- Default settings is:
ServerAddress: symfony.loc/
MySQL Root User: 'root'
MySQL Root Password: 'symfony'
RabbitMQ User: 'rabbitmq'
RabbitMQ User Password: 'rabbitmq_password'
Run vca.bash without any parameters. Actually it's quite useless example because in this case script will do nothing.
//you're in root of your repository
vasyltarasov@Vasyls-MBP toplist% cd docker/
./bin/containers.bash
Script provides basic commands to control containers status.
# Run all containers
vasyltarasov@Vasyls-MBP toplist % ./bin/containers.bash start
# Stop all continaers
vasyltarasov@Vasyls-MBP toplist % ./bin/containers.bash stop
# Restart all containers
vasyltarasov@Vasyls-MBP toplist % ./bin/containers.bash restart
# Build containers
vasyltarasov@Vasyls-MBP toplist % ./bin/containers.bash build
# Containers status
vasyltarasov@Vasyls-MBP toplist % ./bin/containers.bash status
PHP Unit tests must run from container so it's possible to do by these commands.
# It will run tests without coverage
vasyltarasov@Vasyls-MBP toplist % ./bin/containers.bash test
# It's possible to set second paramter to run tests with coverage
vasyltarasov@Vasyls-MBP toplist % ./bin/containers.bash test coverage
If you need to go inside container with PHP to change something or just to take a look you'll need to run this command.
vasyltarasov@Vasyls-MBP toplist % ./bin/containers.bash ssh
# ... after it you'll get inside container as root user
Also inside container exists alias for bin/console
# It's the same commands
php bin/console
# It's the same commands
symfony
It's available to run some Composer commands via the script.
# It will run composer.phar and install all dependecies
vasyltarasov@Vasyls-MBP toplist % composer-install
# It will update the information about packages and update packages if it possible
vasyltarasov@Vasyls-MBP toplist % composer-update
# It allow to install package with name {packageName}
vasyltarasov@Vasyls-MBP toplist % composer-require {packageName}
Say thanks and your ideas to:
Vasyl Tarasov [email protected] Telegram: @mage_f1