Skip to content

Instantly share code, notes, and snippets.

@hernandev
Created August 31, 2016 17:52
Show Gist options
  • Save hernandev/85301df25b2a4a08834a6ef9a8e3fdc5 to your computer and use it in GitHub Desktop.
Save hernandev/85301df25b2a4a08834a6ef9a8e3fdc5 to your computer and use it in GitHub Desktop.
# segunda versão da sintaxe do docker-compose
version: '2'
# volumes para dados persistentes
volumes:
# persistiremos os dados do MySQL
sandbox-mysql-data:
driver: local
# persistiremos os dados do Redis
sandbox-redis-data:
driver: local
services:
# MySQL 5.7, mas você poderia rodar outra versão
# apenas alterando o numero na linha abaixo
mysql:
image: ambientum/mysql:5.7
container_name: sandbox-mysql
volumes:
- sandbox-mysql-data:/var/lib/mysql
ports:
- "3306:3306"
# definicao das senhas do mysql, ajuste como quiser
environment:
- MYSQL_ROOT_PASSWORD=sandbox
- MYSQL_DATABASE=sandbox
- MYSQL_USER=sandbox
- MYSQL_PASSWORD=sandbox
# Redis
cache:
image: ambientum/redis:3.2
container_name: sandbox-redis
command: --appendonly yes
volumes:
- sandbox-redis-data:/data
ports:
- "6379:6379"
# PHP WEB, voce pode trocar o caddy por nginx ou apache,
# a escolha é sua
app:
image: ambientum/php:7.0-caddy
container_name: sandbox-php
volumes:
- .:/var/www/app
ports:
- "80:8080"
links:
- mysql
- cache
# Laravel Queues
queue:
image: ambientum/php:7.0
container_name: sandbox-queue
command: php artisan queue:listen
volumes:
- .:/var/www/app
links:
- mysql
- cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment