Merge pull request #65 from jkaninda/develop

Develop
This commit is contained in:
2023-12-09 18:27:59 +01:00
committed by GitHub
5 changed files with 82 additions and 2 deletions

View File

@@ -80,5 +80,6 @@ jobs:
push: true push: true
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
tags: | tags: |
"${{env.BUILDKIT_IMAGE}}:8.3.0-fpm" "${{env.BUILDKIT_IMAGE}}:8.3.0"
"${{env.BUILDKIT_IMAGE}}:8.3"
"${{env.BUILDKIT_IMAGE}}:latest" "${{env.BUILDKIT_IMAGE}}:latest"

38
.github/workflows/integration-tests.yml vendored Normal file
View File

@@ -0,0 +1,38 @@
name: Integration Test
on:
push:
jobs:
integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create Laravel project
run: |
composer create-project laravel/laravel laravel
- name: Fix Permission
run: chmod -R 777 ./laravel/storage
- name: Run docker-compose
run:
cp ./tests/compose.yaml compose.yaml &&
docker-compose -f "compose.yaml" up -d
- name: Create script.js for K6 test
run: |
touch script.js && cat > script.js <<EOF
import http from 'k6/http';
import { sleep } from 'k6';
export default function () {
//Link
http.get('http://localhost');
}
EOF
- name: Install k6
run: |
curl https://github.com/grafana/k6/releases/download/v0.47.0/k6-v0.47.0-linux-amd64.tar.gz -L | tar xvz --strip-components 1
- name: Test with K6
run: |
./k6 run script.js
- name: Test with curl
run: |
curl -i http://localhost

View File

@@ -1,4 +1,5 @@
[![Build](https://github.com/jkaninda/laravel-php-fpm/actions/workflows/build.yml/badge.svg)](https://github.com/jkaninda/laravel-php-fpm/actions/workflows/build.yml) [![Build](https://github.com/jkaninda/laravel-php-fpm/actions/workflows/build.yml/badge.svg)](https://github.com/jkaninda/laravel-php-fpm/actions/workflows/build.yml)
[![Integration Test](https://github.com/jkaninda/laravel-php-fpm/actions/workflows/integration-tests.yml/badge.svg)](https://github.com/jkaninda/laravel-php-fpm/actions/workflows/integration-tests.yml)
![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/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) ![Docker Pulls](https://img.shields.io/docker/pulls/jkaninda/laravel-php-fpm?style=flat-square)

View File

@@ -3,7 +3,7 @@ Red='\033[0;31m' # Red
Green='\033[0;32m' # Green Green='\033[0;32m' # Green
echo "" echo ""
echo "***********************************************************" echo "***********************************************************"
echo " Starting LARAVEL PHP-FPM Docker Container " echo " Starting LARAVEL PHP-FPM Container "
echo "***********************************************************" echo "***********************************************************"
set -e set -e

40
tests/compose.yaml Normal file
View File

@@ -0,0 +1,40 @@
version: '3'
services:
mysql:
image: mysql:8.0
container_name: mysql
restart: unless-stopped
environment:
MYSQL_DATABASE: php
MYSQL_ROOT_PASSWORD: password
MYSQL_PASSWORD: password
MYSQL_USER: php
ports:
- 3306:3306
php-fpm:
image: jkaninda/laravel-php-fpm:latest
container_name: php-fpm
restart: unless-stopped
depends_on:
- mysql
environment:
DB_HOST: mysql
DB_PORT: 3306
DB_DATABASE: php
DB_USERNAME: php
DB_PASSWORD: password
volumes:
- ./laravel:/var/www/html
#Nginx server
nginx-server:
image: jkaninda/nginx-fpm:stable
container_name: nginx-server
restart: unless-stopped
ports:
- 80:80
volumes:
- ./laravel:/var/www/html
environment:
- DOCUMENT_ROOT=/var/www/html/public
- CLIENT_MAX_BODY_SIZE=20M
- PHP_FPM_HOST=php-fpm:9000