Compare commits

...

7 Commits

Author SHA1 Message Date
033c6b213f Merge pull request #88 from jkaninda/docs
Some checks failed
Build / docker (push) Has been cancelled
Tests / integration (push) Has been cancelled
update readme
2025-07-27 07:25:53 +02:00
1122dc6cff update readme 2025-07-27 07:25:02 +02:00
421512616a UUpdate readme 2025-07-27 07:18:40 +02:00
3f19dbc278 Merge pull request #87 from jkaninda/dev
Some checks failed
Build / docker (push) Has been cancelled
Tests / integration (push) Has been cancelled
Create FUNDING.yml
2025-07-19 02:28:21 +02:00
65b6dd8d73 Create FUNDING.yml 2025-07-19 02:28:00 +02:00
48abada5d7 Update tests (#86)
Some checks failed
Tests / integration (push) Has been cancelled
Build / docker (push) Has been cancelled
* Optimization of entrypoint

* Add version file

* Update tests
2025-05-11 09:45:53 +02:00
86b7f969d3 Optimization of entrypoint (#85)
* Optimization of entrypoint

* Add version file
2025-05-11 09:17:02 +02:00
6 changed files with 99 additions and 51 deletions

1
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1 @@
ko_fi: jkaninda

View File

@@ -6,6 +6,12 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Build Docker Image
run: |
docker buildx build -f src/docker/Dockerfile --build-arg phpVersion=8.4 -t ${{ vars.BUILDKIT_IMAGE }}:latest --load .
- name: Verify Docker images
run: |
docker images
- name: Create Laravel project - name: Create Laravel project
run: | run: |
composer create-project laravel/laravel laravel composer create-project laravel/laravel laravel

View File

@@ -255,8 +255,32 @@ docker compose exec php-fpm /bin/bash
chown -R www-data:www-data /var/www/html chown -R www-data:www-data /var/www/html
chmod -R 775 /var/www/html/storage chmod -R 775 /var/www/html/storage
``` ```
---
### Explore Another Project: Goma Gateway
Are you building a microservices architecture?
Do you need a powerful yet lightweight API Gateway or a high-performance reverse proxy to secure and manage your services effortlessly?
Check out my other project — **[Goma Gateway](https://github.com/jkaninda/goma-gateway)**.
**Goma Gateway** is a high-performance, declarative API Gateway built for modern microservices. It comes with a rich set of built-in middleware, including:
* Basic, JWT, OAuth2, LDAP, and ForwardAuth authentication
* Caching and rate limiting
* Bot detection
* Built-in load balancing
* Simple configuration with minimal overhead
* ...and more!
**Protocol support:** REST, GraphQL, gRPC, TCP, and UDP
**Security:** Automatic HTTPS via Lets Encrypt or use your own TLS certificates
Whether you're managing internal APIs or exposing public endpoints, **Goma Gateway** helps you do it efficiently, securely, and with minimal complexity.
--- ---
### ⭐️ **Support the Project** ### ⭐️ **Support the Project**
If you find this project useful, please give it a ⭐️ on GitHub! 😊 If this project helped you, do not skip on giving it a star. Thanks!

View File

@@ -1,34 +1,45 @@
#!/bin/bash #!/bin/bash
set -e
# Logging functions
log() {
local level=$1
shift
{ set +x; } 2> /dev/null
echo "[$level] $@"
}
info() {
log "INFO" "$@"
}
warning() {
log "WARNING" "$@"
}
fatal() {
log "ERROR" "$@" >&2
exit 1
}
# Banner
echo "" echo ""
echo "***********************************************************" echo "***********************************************************"
echo " Starting LARAVEL PHP-FPM Container " echo " Starting LARAVEL PHP-FPM Container "
echo "***********************************************************" echo "***********************************************************"
set -e # Check if the artisan file exists
info() { ARTISAN_PATH="/var/www/html/artisan"
{ set +x; } 2> /dev/null if [[ -f "$ARTISAN_PATH" ]]; then
echo '[INFO] ' "$@" info "Artisan file found, creating Laravel supervisor config..."
}
warning() { # Create Laravel Supervisor config
{ set +x; } 2> /dev/null SUPERVISOR_TASK="/etc/supervisor/conf.d/laravel-worker.conf"
echo '[WARNING] ' "$@" cat > "$SUPERVISOR_TASK" <<EOF
}
fatal() {
{ set +x; } 2> /dev/null
echo '[ERROR] ' "$@" >&2
exit 1
}
## Check if the artisan file exists
if [ -f /var/www/html/artisan ]; then
info "Artisan file found, creating laravel supervisor config..."
##Create Laravel Scheduler process
TASK=/etc/supervisor/conf.d/laravel-worker.conf
touch $TASK
cat > "$TASK" <<EOF
[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 $ARTISAN_PATH schedule:run --verbose --no-interaction & sleep 60; done"
autostart=true autostart=true
autorestart=true autorestart=true
numprocs=1 numprocs=1
@@ -38,7 +49,7 @@ if [ -f /var/www/html/artisan ]; then
[program:Laravel-worker] [program:Laravel-worker]
process_name=%(program_name)s_%(process_num)02d process_name=%(program_name)s_%(process_num)02d
command=php /var/www/html/artisan queue:work --sleep=3 --tries=3 command=php $ARTISAN_PATH queue:work --sleep=3 --tries=3
autostart=true autostart=true
autorestart=true autorestart=true
numprocs=$LARAVEL_PROCS_NUMBER numprocs=$LARAVEL_PROCS_NUMBER
@@ -46,18 +57,23 @@ if [ -f /var/www/html/artisan ]; then
redirect_stderr=true redirect_stderr=true
stdout_logfile=/var/log/laravel_worker.log stdout_logfile=/var/log/laravel_worker.log
EOF EOF
info "Laravel supervisor config created"
info "Laravel supervisor config created at $SUPERVISOR_TASK"
else else
info "artisan file not found" info "Artisan file not found at $ARTISAN_PATH"
fi fi
## Check if php.ini file exists # Check if custom php.ini file exists
if [ -f /var/www/html/conf/php/php.ini ]; then PHP_INI_SOURCE="/var/www/html/conf/php/php.ini"
cp /var/www/html/conf/php/php.ini $PHP_INI_DIR/conf.d/ PHP_INI_TARGET="$PHP_INI_DIR/conf.d/php.ini"
info "Custom php.ini file found and copied in $PHP_INI_DIR/conf.d/"
if [[ -f "$PHP_INI_SOURCE" ]]; then
cp "$PHP_INI_SOURCE" "$PHP_INI_TARGET"
info "Custom php.ini file found and copied to $PHP_INI_TARGET"
else else
info "Custom php.ini file not found" info "Custom php.ini file not found at $PHP_INI_SOURCE"
info "If you want to add a custom php.ini file, you add it in /var/www/html/conf/php/php.ini" info "To use a custom php.ini file, place it at $PHP_INI_SOURCE"
fi fi
# Start Supervisor
supervisord -c /etc/supervisor/supervisord.conf supervisord -c /etc/supervisor/supervisord.conf

View File

@@ -12,7 +12,7 @@ services:
ports: ports:
- 3306:3306 - 3306:3306
php-fpm: php-fpm:
image: jkaninda/laravel-php-fpm image: jkaninda/laravel-php-fpm:latest
container_name: php-fpm container_name: php-fpm
restart: unless-stopped restart: unless-stopped
#user: www-data #Use www-data user production usage #user: www-data #Use www-data user production usage

1
version Normal file
View File

@@ -0,0 +1 @@
8.4.7