Add checking if the project is based on Laravel

This commit is contained in:
2022-06-21 10:04:42 +02:00
parent 8bf3e8fc29
commit 5aafe76222
4 changed files with 94 additions and 44 deletions

View File

@@ -1,3 +1,8 @@
![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/jkaninda/laravel-php-fpm?style=flat-square)
![Docker Cloud Automated build](https://img.shields.io/docker/cloud/automated/jkaninda/laravel-php-fpm?style=flat-square)
![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/jkaninda/laravel-php-fpm?style=flat-square)
![Docker Pulls](https://img.shields.io/docker/pulls/jkaninda/laravel-php-fpm?style=flat-square)
# 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: