Skip to content

Instantly share code, notes, and snippets.

@philippsander
Last active July 12, 2019 09:05
Show Gist options
  • Save philippsander/a684e1362e9002da2f14198cb22ac5fc to your computer and use it in GitHub Desktop.
Save philippsander/a684e1362e9002da2f14198cb22ac5fc 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;
}
}
@milewski
Copy link

uhm... that video is using old docker syntax ... you`d better catch up the new syntax before it becomes too complicated to understand. they constantly add new stuff...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment