diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0c908e6..dd0ce26 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,12 +18,18 @@ on: name: build jobs: - codeception: - uses: php-forge/actions/.github/workflows/codeception.yml@main - secrets: - AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }} - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - with: - codeception-command: vendor/bin/codecept run --env php-builtin --coverage-xml - coverage-file: runtime/output/coverage.xml - extensions: gd, intl, pcov + franken-php: + runs-on: ubuntu-latest + + steps: + - name: Checkout. + uses: actions/checkout@v5 + + - name: Build and start containers. + run: docker compose up -d --build --wait + + - name: Codeception build. + run: docker exec yii2-frankenphp vendor/bin/codecept build + + - name: Codeception tests. + run: docker exec yii2-frankenphp vendor/bin/codecept run diff --git a/README.md b/README.md index d7ff01f..50ab324 100644 --- a/README.md +++ b/README.md @@ -15,11 +15,11 @@ Yii 22.0.x - - Codeception + + Codeception - - PHPStan + + PHPStan

@@ -40,24 +40,6 @@ A modern, Bootstrap 5-powered Yii2 application template designed for rapid web-a - ✅ **Modern Bootstrap 5 UI** - Responsive, mobile-first design with latest Bootstrap components. - ✅ **Testing Ready** - Codeception test suite with examples for functional and unit testing. -## Available deployment options - -### Traditional Web Servers - -Classic web-server + PHP-FPM setup; simple and widely supported for deployment. - -[![Apache](https://img.shields.io/badge/apache-%23D42029.svg?style=for-the-badge&logo=apache&logoColor=white)](https://github.com/yii2-extensions/app-basic/tree/apache) -[![Nginx](https://img.shields.io/badge/nginx-%23009639.svg?style=for-the-badge&logo=nginx&logoColor=white)](https://github.com/yii2-extensions/app-basic/tree/nginx) - -### High-Performance Worker Mode - -Long-running PHP workers for higher throughput and lower latency. - -[![FrankenPHP](https://img.shields.io/badge/FrankenPHP-777BB4?style=for-the-badge&logo=php&logoColor=white)](https://github.com/yii2-extensions/app-basic/tree/franken-php) -[![RoadRunner](https://img.shields.io/badge/RoadRunner-%23FF6B35.svg?style=for-the-badge&logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEyIDJMMjIgMTJMMTIgMjJMMiAxMkwxMiAyWiIgZmlsbD0iI0ZGRkZGRiIvPgo8cGF0aCBkPSJNOCAyTDE2IDEwTDggMThaIiBmaWxsPSIjRkY2QjM1Ii8+CjxwYXRoIGQ9Ik0xNiA2TDIwIDEwTDE2IDE0WiIgZmlsbD0iI0ZGNkIzNSIvPgo8L3N2Zz4K&logoColor=white)](https://github.com/yii2-extensions/app-basic/tree/road-runner) - -> For setup instructions, see `README.md` in each branch. - ## How it works The Yii2 Web Application Basic template provides a complete foundation for building modern web applications. Unlike starting from scratch, this template includes. @@ -154,14 +136,13 @@ final class SiteController extends Controller ## Package information -[![Latest Stable Version](https://img.shields.io/packagist/v/yii2-extensions/app-basic.svg?style=for-the-badge&logo=packagist&logoColor=white&label=Stable)](https://packagist.org/packages/yii2-extensions/app-basic) -[![Total Downloads](https://img.shields.io/packagist/dt/yii2-extensions/app-basic.svg?style=for-the-badge&logo=packagist&logoColor=white&label=Downloads)](https://packagist.org/packages/yii2-extensions/app-basic) +[![Development Status](https://img.shields.io/badge/Status-Dev-orange.svg?style=for-the-badge&logo=packagist&logoColor=white)](https://github.com/yii2-extensions/app-basic/tree/franken-php-classic) ## Quality code [![Codecov](https://img.shields.io/codecov/c/github/yii2-extensions/app-basic.svg?branch=main&style=for-the-badge&logo=codecov&logoColor=white&label=Coverage)](https://codecov.io/github/yii2-extensions/app-basic) -[![PHPStan Level Max](https://img.shields.io/badge/PHPStan-Level%20Max-4F5D95.svg?style=for-the-badge&logo=php&logoColor=white)](https://github.com/yii2-extensions/app-basic/actions/workflows/static.yml) -[![StyleCI](https://img.shields.io/badge/StyleCI-Passed-44CC11.svg?style=for-the-badge&logo=styleci&logoColor=white)](https://github.styleci.io/repos/165419144?branch=main) +[![PHPStan Level Max](https://img.shields.io/badge/PHPStan-Level%20Max-4F5D95.svg?style=for-the-badge&logo=php&logoColor=white)](https://github.com/yii2-extensions/app-basic/actions/workflows/static.yml?query=branch%3Afranken-php-classic) +[![StyleCI](https://img.shields.io/badge/StyleCI-Passed-44CC11.svg?style=for-the-badge&logo=styleci&logoColor=white)](https://github.styleci.io/repos/165419144?branch=franken-php-classic) ## Documentation diff --git a/codeception.yml b/codeception.yml index 9c300d2..bb00d71 100644 --- a/codeception.yml +++ b/codeception.yml @@ -6,7 +6,6 @@ paths: output: runtime/output data: tests/Support/data support: tests/Support - envs: tests/_envs actor_suffix: Tester settings: memory_limit: 1024M diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..6a13674 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,41 @@ +services: + yii2-frankenphp: + build: + args: + USER_ID: ${USER_ID:-1000} + GROUP_ID: ${GROUP_ID:-1000} + USER_NAME: ${USER_NAME:-www-data} + GROUP_NAME: ${GROUP_NAME:-www-data} + context: . + dockerfile: docker/frankenphp/Dockerfile + container_name: yii2-frankenphp + entrypoint: ["/usr/local/bin/entrypoint.sh"] + env_file: + - .env + environment: + TZ: "UTC" + YII_DEBUG: "${YII_DEBUG:-false}" + YII_ENV: "${YII_ENV:-prod}" + healthcheck: + test: ["CMD-SHELL", "curl -f http://localhost/ || exit 1"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 20s + ports: + - '8080:80' + - '8443:443' + - '8443:443/udp' + restart: always + tty: true + volumes: + - ./:/app + - caddy_config:/config + - caddy_data:/data + - composer_cache:/var/www/.composer/cache + working_dir: /app + +volumes: + caddy_data: + caddy_config: + composer_cache: diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh new file mode 100644 index 0000000..85417ea --- /dev/null +++ b/docker/entrypoint.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -euo pipefail + +echo "=== Container Starting ===" +echo "Running initialization script..." + +# Ensure init script is executable +chmod +x /usr/local/bin/init.sh + +# Execute init script; replace the PID 1 shell +exec /usr/local/bin/init.sh diff --git a/docker/frankenphp/Caddyfile b/docker/frankenphp/Caddyfile new file mode 100644 index 0000000..186bde6 --- /dev/null +++ b/docker/frankenphp/Caddyfile @@ -0,0 +1,66 @@ +{ + # Global options + auto_https off +} + +# HTTPS server block using mkcert certificates +https://localhost:443 { + # Specify mkcert certificates + tls /app/docker/ssl/localhost.pem /app/docker/ssl/localhost-key.pem + + # Document root + root * /app/web + + # Enable PHP processing with FrankenPHP + php_server + + # Security headers + header { + X-Frame-Options "SAMEORIGIN" + X-Content-Type-Options "nosniff" + Referrer-Policy "strict-origin-when-cross-origin" + Permissions-Policy "geolocation=(), camera=(), microphone=()" + # For prod domains only, consider HSTS; avoid for localhost: + # Strict-Transport-Security "max-age=31536000; includeSubDomains" + -Server + } + + # Logging + log { + output stdout + format console + } + + encode zstd gzip + + # Handle static files + @static { + file + path *.css *.js *.png *.jpg *.jpeg *.gif *.ico *.svg *.woff *.woff2 *.ttf *.eot + } + handle @static { + header Cache-Control "public, max-age=31536000, immutable" + file_server + } + + # Block access to sensitive directories + @forbidden { + path /.git/* /vendor/* /runtime/* /.env* + } + respond @forbidden 404 + + # Deny PHP execution in assets directory (Yii2 security) + @assets_php { + path /assets/*.php + } + respond @assets_php 403 + + # Try files for Yii2 URL rewriting + try_files {path} {path}/ /index.php?{query} +} + +# HTTP server block - redirect to HTTPS +http://localhost:80 { + # Redirect all HTTP traffic to HTTPS + redir https://localhost:8443{uri} permanent +} diff --git a/docker/frankenphp/Dockerfile b/docker/frankenphp/Dockerfile new file mode 100644 index 0000000..720aee1 --- /dev/null +++ b/docker/frankenphp/Dockerfile @@ -0,0 +1,74 @@ +FROM dunglas/frankenphp:1.8-php8.4 + +# Build arguments for user/group +ARG USER_ID=1000 +ARG GROUP_ID=1000 +ARG USER_NAME=www-data +ARG GROUP_NAME=www-data + +# Change web server config +COPY docker/frankenphp/Caddyfile /etc/caddy/Caddyfile + +# Set document root to /app/web (Yii2 structure) +WORKDIR /app + +# Install required system packages for PHP extensions for Yii 2.0 Framework +COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ +RUN install-php-extensions \ + bcmath \ + @composer \ + exif \ + gd \ + imagick \ + intl \ + opcache \ + pdo_mysql \ + pdo_pgsql \ + soap \ + xdebug \ + zip + +# Set composer environment +ENV COMPOSER_ALLOW_SUPERUSER=1 + +# Change PHP config +COPY docker/php/php.ini /usr/local/etc/php/conf.d/base.ini + +# Install supervisor, gosu, and Node.js (version simple) +RUN apt-get update && apt-get install -y --no-install-recommends \ + supervisor \ + curl \ + gosu \ + && curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \ + && apt-get install -y nodejs \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +# Apply the user/group IDs to www-data +RUN usermod -u ${USER_ID} www-data && groupmod -g ${GROUP_ID} www-data + +# Create composer and npm cache directories with proper ownership +RUN mkdir -p /var/www/.composer/cache /var/www/.npm && \ + chown -R www-data:www-data /var/www/.composer /var/www/.npm + +# Copy supervisor program configs +COPY docker/supervisor/conf.d/frankenphp.conf /etc/supervisor/conf.d/frankenphp.conf + +# Copy queue worker config uncommented for use with yii2-queue +#COPY docker/supervisor/conf.d/queue.conf /etc/supervisor/conf.d/queue.conf + +# Copy scripts +COPY docker/init.sh /usr/local/bin/init.sh +COPY docker/entrypoint.sh /usr/local/bin/entrypoint.sh + +# Make scripts executable and validate +RUN chmod +x /usr/local/bin/init.sh /usr/local/bin/entrypoint.sh && \ + # Convert any Windows line endings + sed -i 's/\r$//' /usr/local/bin/init.sh /usr/local/bin/entrypoint.sh && \ + # Test that scripts have valid syntax + bash -n /usr/local/bin/init.sh && \ + bash -n /usr/local/bin/entrypoint.sh && \ + echo "✓ Scripts validated successfully..." + +# Use ENTRYPOINT to guarantee execution +ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] diff --git a/docker/init.sh b/docker/init.sh new file mode 100644 index 0000000..4c4dcfb --- /dev/null +++ b/docker/init.sh @@ -0,0 +1,105 @@ +#!/bin/bash + +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +NC='\033[0m' + +echo -e "${GREEN}Starting container setup...${NC}" + +# Create necessary Caddy directories with proper permissions +echo -e "${YELLOW}Creating Caddy directories...${NC}" +mkdir -p /data/caddy/locks /config/caddy +chown -R www-data:www-data /data /config +chmod -R 755 /data /config + +# Create necessary Yii2 directories if they don't exist +echo -e "${YELLOW}Creating Yii2 directories...${NC}" +mkdir -p /app/runtime/cache +mkdir -p /app/runtime/logs +mkdir -p /app/web/assets + +# Configure permissions for Yii2 directories +echo -e "${YELLOW}Setting up permissions...${NC}" + +# Try to set permissions and ownership - handle both mounted volumes and container-only scenarios +if chown -R www-data:www-data /app/runtime 2>/dev/null; then + chmod -R 775 /app/runtime + echo -e "${GREEN}✓ Runtime directory configured correctly${NC}" +else + # If chown fails (mounted volume), try chmod only + if chmod -R 777 /app/runtime 2>/dev/null; then + echo -e "${YELLOW}⚠ Runtime directory permissions set to 777 (mounted volume)${NC}" + else + echo -e "${RED}✗ Error: Could not configure runtime directory${NC}" + fi +fi + +if chown -R www-data:www-data /app/web/assets 2>/dev/null; then + chmod -R 775 /app/web/assets + echo -e "${GREEN}✓ Assets directory configured correctly${NC}" +else + # If chown fails (mounted volume), try chmod only + if chmod -R 777 /app/web/assets 2>/dev/null; then + echo -e "${YELLOW}⚠ Assets directory permissions set to 777 (mounted volume)${NC}" + else + echo -e "${RED}✗ Error: Could not configure assets directory${NC}" + fi +fi + +echo -e "${GREEN}Setup completed.${NC}" + +# Check if composer.json exists and vendor directory doesn't exist +if [ -f "/app/composer.json" ] && [ ! -d "/app/vendor" ]; then + echo -e "${YELLOW}Installing Composer dependencies...${NC}" + + # Give www-data write access without exposing the tree to everyone + chown -R www-data:www-data /app && \ + chmod -R u+rwX,g+rwX /app + + # Create and configure npm cache directory for www-data + mkdir -p /var/www/.npm + chown -R www-data:www-data /var/www/.npm + + # Create and own Composer home & cache for www-data + mkdir -p /var/www/.composer/cache + chown -R www-data:www-data /var/www/.composer + + # Install dependencies with proper environment variables + if [ "$YII_ENV" = "prod" ]; then + # Production: exclude dev dependencies and optimize autoloader + gosu www-data env \ + HOME=/var/www \ + COMPOSER_HOME=/var/www/.composer \ + COMPOSER_CACHE_DIR=/var/www/.composer/cache \ + npm_config_cache=/var/www/.npm \ + composer install --no-dev --optimize-autoloader --no-interaction + else + # Development: include dev dependencies + gosu www-data env \ + HOME=/var/www \ + COMPOSER_HOME=/var/www/.composer \ + COMPOSER_CACHE_DIR=/var/www/.composer/cache \ + npm_config_cache=/var/www/.npm \ + composer install --optimize-autoloader --no-interaction + fi + + echo -e "${GREEN}✓ Composer dependencies installed successfully${NC}" +fi + +# Copy supervisor configuration +echo -e "${YELLOW}Configuring supervisor...${NC}" + +if [ -f "/app/docker/supervisor/supervisord.conf" ]; then + cp /app/docker/supervisor/supervisord.conf /etc/supervisor/supervisord.conf + echo -e "${GREEN}✓ Supervisor configuration copied successfully${NC}" +else + echo -e "${RED}✗ Error: Supervisor configuration file not found${NC}" + exit 1 +fi + +echo -e "${GREEN}Starting supervisor daemon...${NC}" + +# Start supervisor daemon +exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf diff --git a/docker/php/php.ini b/docker/php/php.ini new file mode 100644 index 0000000..aa22113 --- /dev/null +++ b/docker/php/php.ini @@ -0,0 +1,25 @@ +# Global PHP configuration for the Docker container +date.timezone = UTC +display_errors = Off +expose_php = Off +log_errors = On +error_log = /proc/self/fd/2 +memory_limit = 512M +post_max_size = 150M +session.auto_start = Off +short_open_tag = Off +upload_max_filesize = 15M + +# https://symfony.com/doc/current/performance.html +# OPcache optimizations +opcache.enable = 1 +opcache.enable_cli = 1 +opcache.interned_strings_buffer = 16 +opcache.jit = tracing +opcache.jit_buffer_size = 64M +opcache.max_accelerated_files = 20000 +opcache.memory_consumption = 256 +opcache.revalidate_freq = 2 +opcache.validate_timestamps = 1 +realpath_cache_size = 4096K +realpath_cache_ttl = 120 diff --git a/docker/ssl/localhost-key.pem b/docker/ssl/localhost-key.pem new file mode 100644 index 0000000..4677e62 --- /dev/null +++ b/docker/ssl/localhost-key.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDJXRl0fj4a5Myo +WpAN8jevuPIlvS19Yk2243GIXf9rNt7/th4ujMYa7DyGmFE4UiXz/gj5y9vq6/3d +JNrVPqfcBHKgDdGt4V+c6bauzxhs+QilYzft/9/y/Mglt6Z9ibsvIGnRn6R8gc6W +dV2KPRUNDTdb83R0Y7CFRydTkTEYl1/mldAz5MNrlIYrr55PbQTG2fZlMXcfmJOh +TzGvux3skPRD4igTV8rxd0x5RDvcVdSCOx3vpI2ZJ3Vh28Bp934mTNo4Ihsmkn4A +nzUJsyRNAcXp//8xz9upvmy4FfqXhhR5/oOit4INMjFxkEA2CrX7CYz/EiRhyxWt +jGmxKXSVAgMBAAECggEARIxC7BtFvRYCbZVW0MiSGGnXVO2PnM1oM0g+D/QfzTnC +tD4lDCe0ENo2yIL1szyT2vmxyIeTd+eaZjvzmwBXWFjTRJUvuges6tfM7rllUUN9 +o/+gvI6MiEVxRRW9waKvbB2WqFu2PQRbdXDCxRqCHg1PuSepjy2Ym+ZbBuG4Wuwh +q9vbbqe0isp0YZr8oCeNTbR2Mi2q2DPUTP+WdA0TXulx+IwlIlYnIk0a2IGcdGpX +io9Mt3/aspZhx7uQf3yBoVMiOWRx/04t4Yc0oxuwLP4atGd7jhKZ2dfgCo6jPPet +ojIpJgN7vW3o4xRnrv0UuTq9vm2W0ZtV5Zfx4sp/gQKBgQDMBGV5s5itMXSdqoXg +4xtELye0oMYEd1ih8+ql+VP08nUeflV7vD6+Ci8/x++Azqpr9SU1KBG/9Cj2jK8k +uLdeKcEuac8DjU1eELGmDnIk4m0supEP3JyrTQCVQYw9Pwvv+jGNz2zi0xppIzoP +eObU/ftoV3Ue32c9tjMMvzlpBQKBgQD8q57knuAqTVJiIqo1LsRj+j5XQ3IpCYY7 +bVHHi607JywBE8JyerkycYCs6BU4AyZNe8Wp6YJM6qINHgvD13j7CjzSg/YEQVla +O196Ka08Latvu6D3BqR9oKy+5vto/QNxD0hGToWySZCVjbsc5QRxCbq77GZ05EpI +owj0Wz9yUQKBgEpFJ3Pgj6otINjs5QPzaU+vIvM8vBmQIPIES93UIF5BjaVmNFRx +OR4RsxWzAVuQ4LWgbsUlKyEID4mBuZjSrd5XsP3mgvg2Dn458ZIUHDWVQE1SNdDi +bR5nT9kGHbmGJCBeon+PjYIde7XenxpW1yGevFFF1VtB1OHAXGE9k/bJAoGBAJDa +wylGfDVERurD/NioiybWHE9i91vXfgEr1yqTRSkYd/3WGjAPc4Ub1S1LkH6gL6FU +SCn1GSKHkYf7pbsNGOqzH9OAm9YssNEuILqkkhBiDlrsMofsYvky2FZJjfDOvN5g +aIsGEVf5HM7ghlk2Yql7bna2PLbe+kdSUJvmhCVBAoGBAMY9+yNm9zpHYDLfgmeG +mUjUrw73G7j+ucRQI6/owgaqJWKlfULG2CQ18XhcpjJcI7R1gADwNwlJN7AjGDtg +gskDn8yoAGBvaBgkkkv3Z8rKTCGR8mh4bY6G89agY9NphigsaUJrn+4iX59K2/eK +DNFgybL+X7Mh7P8tmBt1Adua +-----END PRIVATE KEY----- diff --git a/docker/ssl/localhost.pem b/docker/ssl/localhost.pem new file mode 100644 index 0000000..7338a1f --- /dev/null +++ b/docker/ssl/localhost.pem @@ -0,0 +1,26 @@ +-----BEGIN CERTIFICATE----- +MIIEYjCCAsqgAwIBAgIRAMJ3dsZ62GwPUcMuKwB/pBQwDQYJKoZIhvcNAQELBQAw +gYcxHjAcBgNVBAoTFW1rY2VydCBkZXZlbG9wbWVudCBDQTEuMCwGA1UECwwlVGVy +YWJ5dGVzb2Z0d1xkZXZlbG9wZXJAVGVyYWJ5dGVzb2Z0dzE1MDMGA1UEAwwsbWtj +ZXJ0IFRlcmFieXRlc29mdHdcZGV2ZWxvcGVyQFRlcmFieXRlc29mdHcwHhcNMjUw +NzEwMjIxNjI2WhcNMjcxMDEwMjExNjI2WjBZMScwJQYDVQQKEx5ta2NlcnQgZGV2 +ZWxvcG1lbnQgY2VydGlmaWNhdGUxLjAsBgNVBAsMJVRlcmFieXRlc29mdHdcZGV2 +ZWxvcGVyQFRlcmFieXRlc29mdHcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK +AoIBAQDJXRl0fj4a5MyoWpAN8jevuPIlvS19Yk2243GIXf9rNt7/th4ujMYa7DyG +mFE4UiXz/gj5y9vq6/3dJNrVPqfcBHKgDdGt4V+c6bauzxhs+QilYzft/9/y/Mgl +t6Z9ibsvIGnRn6R8gc6WdV2KPRUNDTdb83R0Y7CFRydTkTEYl1/mldAz5MNrlIYr +r55PbQTG2fZlMXcfmJOhTzGvux3skPRD4igTV8rxd0x5RDvcVdSCOx3vpI2ZJ3Vh +28Bp934mTNo4Ihsmkn4AnzUJsyRNAcXp//8xz9upvmy4FfqXhhR5/oOit4INMjFx +kEA2CrX7CYz/EiRhyxWtjGmxKXSVAgMBAAGjdjB0MA4GA1UdDwEB/wQEAwIFoDAT +BgNVHSUEDDAKBggrBgEFBQcDATAfBgNVHSMEGDAWgBRlhRQpnl7nIy6O/r3UOcaY +LgXBSzAsBgNVHREEJTAjgglsb2NhbGhvc3SHBH8AAAGHEAAAAAAAAAAAAAAAAAAA +AAEwDQYJKoZIhvcNAQELBQADggGBAIR0dkwyUST+W8TATCZbYThwiYuTSLYyQvyX +7ieIYWW31nAfcL/WvMt5d80p67mLPvGoGLZSayId7uf6j0LVY2Y94G1z7HOdRd7s +D7InIrLI0G7pKSXI8mSCczgpx2FD2yIkHaDCdZIYXpkkAhJ6I4hghSG2KZoJ0vhA +JPTd9VW8ydYykfE619wjZ68RUlve4wtNkmQCrJAWOZMWCNl8O/iz5cWafTr0p4kD +6qdE/gKvfyWQdc1XgPpZJkpYNw+CGVcpfE7i/++FfspTTY+XyYZClbQjMD1hNGq/ +ATsl8DR4xH5ztUaAkLBRDXpXGal7VyNoBpBot9scDR71YMsTTKf/1NdIt8gPLF4P +ULwW7UvaHQAj3klPcanEaTv/bgQxor6b8tSwMLqHcU+SdQBjYnWLuAzKTCvL9m73 +MQRRt/N+Z9McSApps0F82eSR3a1HaU5lyH6Es6dLkVnY/ksmzqwi5FADsORSH95M +GvP9WbrnCQvIW/n3T3pvmuV/BeRkVg== +-----END CERTIFICATE----- diff --git a/docker/supervisor/conf.d/frankenphp.conf b/docker/supervisor/conf.d/frankenphp.conf new file mode 100644 index 0000000..1765320 --- /dev/null +++ b/docker/supervisor/conf.d/frankenphp.conf @@ -0,0 +1,13 @@ +[program:frankenphp] +command=/usr/local/bin/frankenphp run --config /etc/caddy/Caddyfile +autorestart=true +autostart=true +killasgroup=true +priority=10 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stopasgroup=true +stopsignal=TERM +user=www-data diff --git a/docker/supervisor/conf.d/queue.conf b/docker/supervisor/conf.d/queue.conf new file mode 100644 index 0000000..f6f2f60 --- /dev/null +++ b/docker/supervisor/conf.d/queue.conf @@ -0,0 +1,16 @@ +[program:yii-queue-worker] +process_name=%(program_name)s_%(process_num)02d +command=/usr/local/bin/php /app/yii queue/listen --verbose=1 --color=0 +autorestart=true +# Enable only after installing yiisoft/yii2-queue; flipped on via image build or entrypoint. +autostart=false +# Keep demo light; can be raised later. +numprocs=1 +stopasgroup=true +killasgroup=true +stopsignal=TERM +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +user=www-data diff --git a/docker/supervisor/supervisord.conf b/docker/supervisor/supervisord.conf new file mode 100644 index 0000000..d209121 --- /dev/null +++ b/docker/supervisor/supervisord.conf @@ -0,0 +1,14 @@ +[supervisord] +logfile = /proc/self/fd/1 +logfile_maxbytes = 0 +loglevel = info +nodaemon = true +pidfile = /var/run/supervisord.pid +silent = true +user = root + +[include] +files = /etc/supervisor/conf.d/*.conf + +[supervisorctl] +serverurl = unix:///var/run/supervisor.sock diff --git a/tests/Acceptance.suite.yml b/tests/Acceptance.suite.yml index 03e52e8..2e0af2a 100644 --- a/tests/Acceptance.suite.yml +++ b/tests/Acceptance.suite.yml @@ -7,5 +7,5 @@ actor: AcceptanceTester modules: enabled: - PhpBrowser: - url: localhost:8080 + url: https://localhost:443/ step_decorators: ~ diff --git a/tests/_envs/dockerized.yml b/tests/_envs/dockerized.yml deleted file mode 100644 index 546f0cc..0000000 --- a/tests/_envs/dockerized.yml +++ /dev/null @@ -1,4 +0,0 @@ -modules: - config: - PhpBrowser: - url: https://localhost:443 diff --git a/tests/_envs/php-builtin.yml b/tests/_envs/php-builtin.yml deleted file mode 100644 index ce9c804..0000000 --- a/tests/_envs/php-builtin.yml +++ /dev/null @@ -1,9 +0,0 @@ -extensions: - enabled: - - Codeception\Extension\RunProcess: - 0: php -d variables_order=EGPCS -S localhost:8085 -t web - sleep: 1 -modules: - config: - PhpBrowser: - url: http://localhost:8085