Created
January 31, 2019 16:11
-
-
Save jmsfwk/f2c39eb8da03be99253cef6dcd3b1c57 to your computer and use it in GitHub Desktop.
Laravel docker compose configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 80; | |
| root /usr/share/nginx/html; | |
| index index.html index.htm index.php; | |
| charset utf-8; | |
| location / { | |
| try_files $uri $uri/ /index.php?$query_string; | |
| } | |
| # pass the PHP scripts to FastCGI server listening on php:9000 | |
| location ~ \.php$ { | |
| root /app; | |
| fastcgi_pass php:9000; | |
| include fastcgi_params; | |
| fastcgi_index index.php; | |
| fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: "3" | |
| services: | |
| web: | |
| image: nginx:alpine | |
| ports: | |
| - "80:80" | |
| volumes: | |
| - ./public:/usr/share/nginx/html:ro | |
| - .docker/web/default.conf:/etc/nginx/conf.d/default.conf:ro | |
| php: | |
| image: php:7.1-fpm-alpine | |
| volumes: | |
| - .:/app | |
| database: | |
| env_file: | |
| - .env | |
| image: mysql | |
| ports: | |
| - "3306:3306" | |
| volumes: | |
| - database:/var/lib/mysql | |
| environment: | |
| MYSQL_ALLOW_EMPTY_PASSWORD: "yes" | |
| MYSQL_DATABASE: ${DB_DATABASE} | |
| MYSQL_USER: ${DB_USERNAME} | |
| MYSQL_PASSWORD: ${DB_PASSWORD} | |
| volumes: | |
| database: |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This will read the settings from the Laravel .env file to set up the database automatically.