dunglas / frankenphp

🧟 The modern PHP app server
https://frankenphp.dev
MIT License
6.88k stars 235 forks source link

[QUESTION] How to know that my laravel octane is working #763

Closed ezekel closed 6 months ago

ezekel commented 6 months ago

Hi,

I don't if I am doing it correctly, First of all, I am not using Laravel Sail, I am using my own docker file and docker-compose. I just want to know how do I know that the octane working properly in my setup. I visited my app https://api.myapp.local/. and it's working.

here is my docker file

FROM dunglas/frankenphp:latest

RUN install-php-extensions \
    pdo_mysql \
    gd \
    intl \
    zip \
    opcache\
    pcntl

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

ENV SERVER_NAME=":80"

COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY --link Caddyfile /etc/caddy/Caddyfile
COPY . /app

docker-compose

services:
      php:
        container_name: frankencontainer
        build:
            context: .
            dockerfile: ./docker/web.dockerfile
        image: frankenimage

        ports:
            - "80:80" # HTTP
            - "443:443" # HTTPS
            - "443:443/udp" # HTTP/3

        volumes:
            - caddy_data:/data
            - caddy_config:/config
            - ./:/app
        environment:
            - SERVER_NAME=api.myapp.local
dunglas commented 6 months ago

You can check if $_SERVER['FRANKENPHP_WORKER'] is defined.

dunglas commented 6 months ago

Your Dockerfile doesn't look good to me. You could use or adapt this one: https://laravel.com/docs/11.x/octane#frankenphp-via-docker

ezekel commented 6 months ago

Thank you I will try that link,I'll be back