mirror of
https://github.com/jkaninda/laravel-php-fpm.git
synced 2025-12-06 08:59:38 +01:00
Add checking if the project is based on Laravel
This commit is contained in:
33
README.md
33
README.md
@@ -1,3 +1,8 @@
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
# Laravel PHP-FPM Docker image
|
||||
|
||||
> 🐳 Docker image for a PHP-FPM container crafted to run Laravel or any php based applications.
|
||||
@@ -30,7 +35,7 @@
|
||||
version: '3'
|
||||
services:
|
||||
php-fpm:
|
||||
image: jkaninda/laravel-php-fpm:<Tagname> or latest
|
||||
image: jkaninda/laravel-php-fpm:<tagname> or latest
|
||||
container_name: php-fpm
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
@@ -44,13 +49,13 @@ services:
|
||||
```
|
||||
## Laravel `artisan` command usage:
|
||||
### Open php-fpm
|
||||
```bash
|
||||
```sh
|
||||
docker-compose exec php-fpm /bin/bash
|
||||
|
||||
```
|
||||
|
||||
### Laravel migration
|
||||
```bash
|
||||
```sh
|
||||
php atisan migrate
|
||||
|
||||
```
|
||||
@@ -60,14 +65,17 @@ php atisan migrate
|
||||
version: '3'
|
||||
services:
|
||||
php-fpm:
|
||||
image: jkaninda/laravel-php-fpm:<Tagname> or latest
|
||||
image: jkaninda/laravel-php-fpm
|
||||
container_name: php-fpm
|
||||
restart: unless-stopped
|
||||
working_dir: /var/www #Optional If you want to use a custom directory
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
#Project root
|
||||
- ./:/var/www/
|
||||
- ~/.ssh:/root/.ssh # If you use private CVS
|
||||
|
||||
environment:
|
||||
- APP_ENV=development # or production
|
||||
- WORKDIR=/var/www #Optional If you want to use a custom directory
|
||||
networks:
|
||||
- default #if you're using networks between containers
|
||||
#Nginx server
|
||||
@@ -79,13 +87,13 @@ services:
|
||||
- 80:80
|
||||
volumes:
|
||||
- ./:/var/www
|
||||
- ./nginx/conf.d/:/etc/nginx/conf.d/
|
||||
- ./default.conf:/etc/nginx/conf.d/default.conf
|
||||
networks:
|
||||
- default
|
||||
|
||||
```
|
||||
## Simple Nginx config file content
|
||||
### nginx/conf.d/default.conf
|
||||
### default.conf
|
||||
|
||||
```conf
|
||||
|
||||
@@ -94,12 +102,12 @@ server {
|
||||
index index.php index.html;
|
||||
error_log /var/log/nginx/error.log;
|
||||
access_log /var/log/nginx/access.log;
|
||||
##Root directory
|
||||
##Public directory
|
||||
root /var/www/public;
|
||||
location ~ \.php$ {
|
||||
try_files $uri =404;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
## PHP FPM ( php-fpm:9000 )
|
||||
## PHP FPM ( php-fpm:9000 ) or [servicename:9000]
|
||||
fastcgi_pass php-fpm:9000;
|
||||
fastcgi_index index.php;
|
||||
include fastcgi_params;
|
||||
@@ -123,8 +131,11 @@ server {
|
||||
|
||||
```
|
||||
## Docker run
|
||||
```bash
|
||||
```sh
|
||||
docker-compose up -d
|
||||
|
||||
```
|
||||
|
||||
> P.S. please give a star if you like it :wink:
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user