Skip to content

Instantly share code, notes, and snippets.

@thedevsaddam
Forked from philippsander/docker-compose.yml
Created July 4, 2017 08:24
Show Gist options
  • Select an option

  • Save thedevsaddam/ac7db252fa891b2a48ea07dbc2ccfeb3 to your computer and use it in GitHub Desktop.

Select an option

Save thedevsaddam/ac7db252fa891b2a48ea07dbc2ccfeb3 to your computer and use it in GitHub Desktop.
mysql:
image: mysql
container_name: database
ports:
- 3306:3306
environment:
MYSQL_DATABASE: laravel
MYSQL_ROOT_PASSWORD: 123456
php:
image: php:fpm-alpine
container_name: php
volumes:
- .:/var/www/laravel
entrypoint:
- php-fpm
nginx:
image: nginx:alpine
container_name: nginx
volumes_from:
- php
volumes:
- ./build/nginx.conf:/etc/nginx/conf.d/default.conf
links:
- php
ports:
- 8080:80
server {
listen 80;
root /var/www/laravel/public;
index index.php index.html index.htm;
server_name laravel.dev;
location / {
sendfile off;
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php:9000;
fastcgi_index index.php;
fastcgi_param SCRIPTFILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment