https://github.com/iulyanp/docker-dev-stack
Docker stack environment gives you everything you need for develop PHP web applications
https://github.com/iulyanp/docker-dev-stack
docker memcache mysql nginx php-fpm rabbitmq redis
Last synced: 8 months ago
JSON representation
Docker stack environment gives you everything you need for develop PHP web applications
- Host: GitHub
- URL: https://github.com/iulyanp/docker-dev-stack
- Owner: iulyanp
- Created: 2018-04-07T19:15:27.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-07T17:21:16.000Z (almost 8 years ago)
- Last Synced: 2025-04-08T07:39:57.271Z (11 months ago)
- Topics: docker, memcache, mysql, nginx, php-fpm, rabbitmq, redis
- Language: HTML
- Homepage:
- Size: 31.3 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Docker dev stack
-----
Docker stack environment gives you everything you need for develop PHP web applications.
- Portainer
- PHP7-FPM
- NGINX
- MySQL
- Memcache
- Redis
- RabbitMQ
### Installation
1. Create a .env from the .env.dist file. Adapt it according to your needs
```
$ cp .env.example .env
```
2. Add a new nginx vhost file for your project
Before you start the containers, you have to add a vhost file to `config/sites` folder.
If you are using Symfony framework you can find
[here](https://symfony.com/doc/current/setup/web_server_configuration.html#nginx) an example of the configuration
for nginx.
> Note! You have to use the socket for php-fpm which is mapped in a volume on `/var/run/php-fpm/php-fpm.sock`
3. Update your system host file
```
# project.local is the server_name set up on the vhost
$ echo project.local >> /etc/hosts
```
### Usage
Just run `docker-compose up -d` and you'll have all the containers up and running.
### How it works
You can find in the `docker-compose` file all the services of the dev stack:
- mysql: The MySQL database container
- memcache: The Memcache container
- redis: This is the Redis container
- php-fpm: This is the PHP-FPM container in which the application volume is mounted
- nginx: This is the Nginx webserver container, also in which application volume is mounted
- rabbitmq: This is the RabbitMQ container you can use to create your queues
- portainer: This is the container that will provide you a nice and useful web interface for Docker (visit
[http://localhost:8085](http://localhost:8085))
If you want to see what containers are running you can use:
```
$ docker-compose ps
Name Command State Ports
-------------------------------------------------------------------------------------------------------------------------------------------------
memcache docker-entrypoint.sh memcached Up 0.0.0.0:11211->11211/tcp
mysql docker-entrypoint.sh mysqld Up 0.0.0.0:3306->3306/tcp
nginx supervisord -n -c /etc/sup ... Up 0.0.0.0:80->80/tcp
php-fpm /bin/sh -c entrypoint.sh Up
portainer /portainer Up 0.0.0.0:8085->9000/tcp
rabbitmq docker-entrypoint.sh rabbi ... Up 0.0.0.0:8081->15672/tcp, 25672/tcp, 4369/tcp, 0.0.0.0:5671->5671/tcp, 0.0.0.0:5672->5672/tcp
redis docker-entrypoint.sh redis ... Up 0.0.0.0:6379->6379/tcp
```