Skip to content

Instantly share code, notes, and snippets.

@karllhughes
Last active April 8, 2021 06:57
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save karllhughes/35a093473663175f774072858f7d1a9c to your computer and use it in GitHub Desktop.
laravel php docker compose file
version: "2"
services:
web:
image: karllhughes/php-fpm-mysql:latest
restart: always
links:
- database
- redis
env_file:
- .env
volumes:
- ./:/var/www/html:cached
worker:
image: karllhughes/php-fpm-mysql:latest
restart: always
links:
- database
- redis
env_file:
- .env
volumes:
- ./:/var/www/html:cached
command: php artisan queue:work --tries=3 --sleep=10
database:
image: mariadb
restart: always
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=1
volumes:
- .data/:/var/lib/mysql
ports:
- "33060:3306"
nginx:
image: tutum/nginx:latest
restart: always
ports:
- "47000:8000"
links:
- web
volumes:
- ./nginx:/etc/nginx/sites-enabled
redis:
image: redis:alpine
restart: always
server {
listen 8000;
server_name localhost;
root /var/www/html/public;
index index.html index.htm index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
fastcgi_pass web:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $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