Which container is running vite? Node? If so, the port should be opened on that container
Aug 26, 2022
10
Level 1
Laravel Vite without Sail
I am running a fresh installation of Laravel 9 with VIte and Docker (No Sail) and the build doesn't work properly.
Browser is throwing the following error
GET http://127.0.0.1:3000/resources/sass/app.scss net::ERR_EMPTY_RESPONSE
GET http://127.0.0.1:3000/@vite/client net::ERR_EMPTY_RESPONSE
GET http://127.0.0.1:3000/resources/js/app.js net::ERR_EMPTY_RESPONSE
Below is my docker and vite config
networks:
form_filler:
services:
nginx:
image: nginx:stable-alpine
container_name: nginx
ports:
- 80:80
- 443:443
depends_on:
- php
- node
- mysql
volumes:
- ./src:/var/www/html
- ./docker/nginx:/etc/nginx/conf.d
networks:
- form_filler
node:
image: node:alpine
container_name: node
working_dir: /var/www/html
tty: true
volumes:
- ./src:/var/www/html
networks:
- form_filler
php:
build:
context: ./docker
dockerfile: dockerfile
container_name: php
ports:
- 9000:9000
- 3000:3000
volumes:
- ./src:/var/www/html
networks:
- form_filler
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
export default defineConfig({
plugins: [
laravel([
'resources/css/app.css',
'resources/sass/app.scss',
'resources/js/app.js',
]),
],
server: {
hmr: {
host: 'localhost'
}
}
});
Any help would be appreciated
Please or to participate in this conversation.