Giter VIP home page Giter VIP logo

Comments (5)

sneycampos avatar sneycampos commented on September 12, 2024

Could you share your entire code? docker-compose.yml and Dockerfile? Did you configure the file watcher?

from frankenphp.

ezekel avatar ezekel commented on September 12, 2024

Could you share your entire code? docker-compose.yml and Dockerfile? Did you configure the file watcher?

Here is my dockerfile ,docker-compose and package.json

Docker desktop version

Docker Desktop 4.33.1 (161083)

FROM dunglas/frankenphp:latest AS builder

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



RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \
    && apt-get install -y nodejs \
    && npm install -g npm@latest \
    && node --version \
    && npm --version

RUN apt-get update && apt-get install -y \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*


WORKDIR /app

COPY . /app

RUN npm install


EXPOSE 5173

FROM builder  AS development

RUN composer install

ENTRYPOINT ["php", "artisan", "octane:frankenphp"]

docker-compose

    php2:
        container_name: larabells
        build:
            context: .
            dockerfile: ./docker/web.dockerfile
            target: development
        image: larabells

        ports:
            - "80:80"
            - "443:443"
            - "443:443/udp" # HTTP/3
            - "5173:5173"
        volumes:
            - ./:/app
        entrypoint: php artisan octane:frankenphp --watch --host=larabells.local --port=443  --admin-port=2019 --https
        environment:
            - SERVER_NAME=larabells.local

        env_file:
            - ./.env
        networks:
            - mynetwork
            

I also tried to add a watch as you mentioned above but still not working

here is my pacakte.json

{
    "private": true,
    "type": "module",
    "scripts": {
        "dev": "vite",
        "build": "vite build"
    },
    "devDependencies": {
        "@tailwindcss/forms": "^0.5.2",
        "alpinejs": "^3.4.2",
        "autoprefixer": "^10.4.2",
        "axios": "^1.6.4",
        "chokidar": "^3.6.0",
        "laravel-vite-plugin": "^1.0",
        "postcss": "^8.4.31",
        "tailwindcss": "^3.1.0",
        "vite": "^5.0"
    }
}

here is my api.php, I tried in postman but always return hello-1. even I edit it to hello-2.

Route::get('/books', function (Request $request) {
    return 'hello-1';
})->middleware('auth:sanctum');

Here is my vite.js

export default defineConfig({
    plugins: [
        laravel({
            input: [
                'resources/css/app.css',
                'resources/js/app.js',
            ],
            refresh: true,
        }),
    ],
    server: {
        hmr: {
            host: 'localhost',
        },
        host: '0.0.0.0',
    }
});

Thank you in advance

from frankenphp.

sneycampos avatar sneycampos commented on September 12, 2024

Thank you in advance

Take a look at this how to use octane in dev environment with the max-requests flag

from frankenphp.

AlliBalliBaba avatar AlliBalliBaba commented on September 12, 2024

Have you tried installing chokidar globally in your Dockerfile? This works form me:

...

RUN npm i chokidar -g
ENTRYPOINT ["php", "artisan", "octane:frankenphp", "--watch"]

from frankenphp.

ezekel avatar ezekel commented on September 12, 2024

I reinstalled the vendor and node_modules and added the --watch flag, and the API is working i can see now the updated response

Thank you for helping me

from frankenphp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.