mirror of
https://github.com/jkaninda/laravel-php-fpm.git
synced 2025-12-07 17:29:38 +01:00
Merge 8.1
This commit is contained in:
7
.github/workflows/build.yml
vendored
7
.github/workflows/build.yml
vendored
@@ -1,14 +1,9 @@
|
|||||||
name: ci
|
name: Docker image build and Push Image to registry
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- '**'
|
- '**'
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- closed
|
|
||||||
branches:
|
|
||||||
- '**'
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
#BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
|
#BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ FROM php:8.2.0RC5-fpm
|
|||||||
ARG WORKDIR=/var/www/html
|
ARG WORKDIR=/var/www/html
|
||||||
ENV DOCUMENT_ROOT=${WORKDIR}
|
ENV DOCUMENT_ROOT=${WORKDIR}
|
||||||
ENV LARAVEL_PROCS_NUMBER=1
|
ENV LARAVEL_PROCS_NUMBER=1
|
||||||
ENV NODE_VERSION=16.x
|
ENV NODE_VERSION=17.x
|
||||||
# Install system dependencies
|
# Install system dependencies
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
git \
|
git \
|
||||||
|
|||||||
@@ -79,14 +79,17 @@ services:
|
|||||||
- default #if you're using networks between containers
|
- default #if you're using networks between containers
|
||||||
#Nginx server
|
#Nginx server
|
||||||
nginx-server:
|
nginx-server:
|
||||||
image: nginx:alpine
|
image: jkaninda/nginx-fpm:alpine
|
||||||
container_name: nginx-server
|
container_name: nginx-server
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- 80:80
|
- 80:80
|
||||||
volumes:
|
volumes:
|
||||||
- ./:/var/www/html
|
- ./:/var/www/html
|
||||||
- ./default.conf:/etc/nginx/conf.d/default.conf
|
environment:
|
||||||
|
- DOCUMENT_ROOT=/var/www/html/public
|
||||||
|
- CLIENT_MAX_BODY_SIZE=20M
|
||||||
|
- PHP_FPM_HOST=php-fpm:9000
|
||||||
networks:
|
networks:
|
||||||
- default
|
- default
|
||||||
|
|
||||||
|
|||||||
@@ -11,13 +11,16 @@ services:
|
|||||||
- default #if you're using networks between containers
|
- default #if you're using networks between containers
|
||||||
#Nginx server
|
#Nginx server
|
||||||
nginx-server:
|
nginx-server:
|
||||||
image: nginx:alpine
|
image: jkaninda/nginx-fpm:alpine
|
||||||
container_name: nginx-server
|
container_name: nginx-server
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- 80:80
|
- 80:80
|
||||||
volumes:
|
volumes:
|
||||||
- ./laravel:/var/www/html
|
- ./laravel:/var/www/html
|
||||||
- ./example/default.conf:/etc/nginx/conf.d/default.conf
|
environment:
|
||||||
|
- DOCUMENT_ROOT=/var/www/html/public
|
||||||
|
- CLIENT_MAX_BODY_SIZE=20M
|
||||||
|
- PHP_FPM_HOST=php-fpm:9000
|
||||||
networks:
|
networks:
|
||||||
- default
|
- default
|
||||||
|
|||||||
@@ -17,14 +17,14 @@ if [ -f /var/www/html/artisan ]; then
|
|||||||
cat > "$TASK" <<EOF
|
cat > "$TASK" <<EOF
|
||||||
[supervisord]
|
[supervisord]
|
||||||
nodaemon=true
|
nodaemon=true
|
||||||
user=root
|
user=www-data
|
||||||
[program:Laravel-scheduler]
|
[program:Laravel-scheduler]
|
||||||
process_name=%(program_name)s_%(process_num)02d
|
process_name=%(program_name)s_%(process_num)02d
|
||||||
command=/bin/sh -c "while [ true ]; do (php /var/www/html/artisan schedule:run --verbose --no-interaction &); sleep 60; done"
|
command=/bin/sh -c "while [ true ]; do (php /var/www/html/artisan schedule:run --verbose --no-interaction &); sleep 60; done"
|
||||||
autostart=true
|
autostart=true
|
||||||
autorestart=true
|
autorestart=true
|
||||||
numprocs=1
|
numprocs=1
|
||||||
user=root
|
user=www-data
|
||||||
stdout_logfile=/var/log/laravel_scheduler.out.log
|
stdout_logfile=/var/log/laravel_scheduler.out.log
|
||||||
redirect_stderr=true
|
redirect_stderr=true
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ if [ -f /var/www/html/artisan ]; then
|
|||||||
autostart=true
|
autostart=true
|
||||||
autorestart=true
|
autorestart=true
|
||||||
numprocs=$LARAVEL_PROCS_NUMBER
|
numprocs=$LARAVEL_PROCS_NUMBER
|
||||||
user=root
|
user=www-data
|
||||||
redirect_stderr=true
|
redirect_stderr=true
|
||||||
stdout_logfile=/var/log/laravel_worker.log
|
stdout_logfile=/var/log/laravel_worker.log
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
26
example/docker-compose.yml
Normal file
26
example/docker-compose.yml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
php-fpm:
|
||||||
|
image: jkaninda/laravel-php-fpm:8.1
|
||||||
|
container_name: php-fpm
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
#Project root
|
||||||
|
- ./:/var/www/html
|
||||||
|
networks:
|
||||||
|
- default #if you're using networks between containers
|
||||||
|
#Nginx server
|
||||||
|
nginx-server:
|
||||||
|
image: jkaninda/nginx-fpm:alpine
|
||||||
|
container_name: nginx-server
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- 80:80
|
||||||
|
volumes:
|
||||||
|
- ./:/var/www/html
|
||||||
|
environment:
|
||||||
|
- DOCUMENT_ROOT=/var/www/html/public
|
||||||
|
- CLIENT_MAX_BODY_SIZE=20M
|
||||||
|
- PHP_FPM_HOST=php-fpm:9000
|
||||||
|
networks:
|
||||||
|
- default
|
||||||
Reference in New Issue
Block a user