Update php version

This commit is contained in:
2022-06-22 03:15:32 +02:00
2 changed files with 43 additions and 14 deletions

View File

@@ -1,6 +1,6 @@
FROM php:8.0-fpm FROM php:8.0-fpm
ENV WORKDIR=/var/www ENV WORKDIR=/var/www/html
ENV STORAGE_DIR=/var/www/storage ENV STORAGE_DIR=/var/www/html/storage
ENV LARAVEL_PROCS_NUMBER=2 ENV LARAVEL_PROCS_NUMBER=2
# Install system dependencies # Install system dependencies
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \

View File

@@ -35,14 +35,12 @@
version: '3' version: '3'
services: services:
php-fpm: php-fpm:
image: jkaninda/laravel-php-fpm:<tagname> or latest image: jkaninda/laravel-php-fpm:latest
container_name: php-fpm container_name: php-fpm
restart: unless-stopped restart: unless-stopped
volumes: volumes:
#Project root #Project root
- ./:/var/www/ - ./:/var/www/html
- ~/.ssh:/root/.ssh # If you use private CVS
networks: networks:
- default #if you're using networks between containers - default #if you're using networks between containers
@@ -67,15 +65,10 @@ services:
php-fpm: php-fpm:
image: jkaninda/laravel-php-fpm image: jkaninda/laravel-php-fpm
container_name: php-fpm container_name: php-fpm
working_dir: /var/www #Optional If you want to use a custom directory
restart: unless-stopped restart: unless-stopped
volumes: volumes:
#Project root #Project root
- ./:/var/www/ - ./:/var/www/html
- ~/.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: networks:
- default #if you're using networks between containers - default #if you're using networks between containers
#Nginx server #Nginx server
@@ -86,7 +79,7 @@ services:
ports: ports:
- 80:80 - 80:80
volumes: volumes:
- ./:/var/www - ./:/var/www/html
- ./default.conf:/etc/nginx/conf.d/default.conf - ./default.conf:/etc/nginx/conf.d/default.conf
networks: networks:
- default - default
@@ -103,7 +96,7 @@ server {
error_log /var/log/nginx/error.log; error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log; access_log /var/log/nginx/access.log;
##Public directory ##Public directory
root /var/www/public; root /var/www/html/public;
location ~ \.php$ { location ~ \.php$ {
try_files $uri =404; try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_split_path_info ^(.+\.php)(/.+)$;
@@ -129,7 +122,43 @@ server {
} }
} }
## Advanced Laravel-php-fpm with nginx:
### docker-compose.yml
```yml
version: '3'
services:
php-fpm:
image: jkaninda/laravel-php-fpm
container_name: php-fpm
working_dir: /var/www/html #Optional, If you want to use a custom directory
restart: unless-stopped
volumes:
#Project root
- ./:/var/www/html
- ~/.ssh:/root/.ssh # If you use private CVS
- ./supervisord:/etc/supervisor/conf.d/ # Supervisor directory, if you want to add more supervisor process config file
- ./php.ini:/usr/local/etc/php/conf.d/php.ini # Optional, your custom php init file
- storage-data:/var/www/html/storage/app #Optional, your custom storage data
environment:
- APP_ENV=development # Optional, or production
- WORKDIR=/var/www/html #Optional, If you want to use a custom directory
- LARAVEL_PROCS_NUMBER=3 # Optional, Laravel queue:work process number
#Nginx server
nginx-server:
image: nginx:alpine
container_name: nginx-server
restart: unless-stopped
ports:
- 80:80
volumes:
- ./:/var/www/html
- ./default.conf:/etc/nginx/conf.d/default.conf
networks:
- default
volumes:
storage-data:
``` ```
## Docker run ## Docker run
```sh ```sh
docker-compose up -d docker-compose up -d