Skip to content

Instantly share code, notes, and snippets.

@g0ld3lux
Created November 27, 2016 07:37
Show Gist options
  • Save g0ld3lux/8d7e5aaf812f028c2a289e65073274a5 to your computer and use it in GitHub Desktop.
Save g0ld3lux/8d7e5aaf812f028c2a289e65073274a5 to your computer and use it in GitHub Desktop.
Scaling Out Laravel with Docker
haproxy:
image: interaction/haproxy:master
links:
- letsencrypt
- web
ports:
- "80:80"
- "443:443"
volumes_from:
- letsencrypt
environment:
- BALANCE=source
web:
build: ./web
environment:
- VIRTUAL_HOST=*,https://*
- FORCE_SSL=yes
volumes:
- ./web/config/conf.d:/etc/nginx/conf.d
- ./web/config/sites-enabled:/etc/nginx/sites-enabled
- ../:/var/www/laravel/
links:
- db
- cache
db:
image: mysql:5.7
volumes:
- ./data/mysql:/var/lib/mysql
restart: always
ports:
- "3306:3306"
environment:
MYSQL_DATABASE: homestead
MYSQL_USER: homestead
MYSQL_PASSWORD: secret
MYSQL_ROOT_PASSWORD: root
cache:
image: redis:alpine
command: redis-server --requirepass redis --appendonly yes
volumes:
- ./data/redis:/data
restart: always
ports:
- "6379:6379"
letsencrypt:
image: interaction/letsencrypt:master
environment:
- DOMAINS=scalingout.dev,www.scalingout.dev;
- EMAIL=admins@interaction.net.au
- OPTIONS=--test-cert
expose:
- "80"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment