Hello from future,
I managed to resolve this by changing the vite.config.jg:
import {
defineConfig
} from 'vite';
import laravel from 'laravel-vite-plugin';
import vuePlugin from "@vitejs/plugin-vue";
export default defineConfig({
plugins: [
laravel({
input: ['resources/css/app.css', 'resources/js/app.js'],
refresh: true,
}),
vuePlugin(),
],
server: {
host: true,
port: 5173,
},
});
And also have the following in my docker-compose.yml (I omit the db config):
version: '3'
services:
# laravel
laravel:
build:
context: ./src
dockerfile: ../config/laravel/Dockerfile
image: digitalocean.com/php
container_name: laravel
restart: unless-stopped
tty: true
ports:
- "5173:5173"
environment:
SERVICE_NAME: laravel
SERVICE_TAGS: dev
working_dir: /var/www
volumes:
- ./src/:/var/www
networks:
- laranet
# Nginx Backend Service
laravel-webserver:
image: nginx:alpine
container_name: laravel-webserver
restart: unless-stopped
tty: true
ports:
- "8085:80"
volumes:
- ./src/:/var/www
- ./config/nginx/conf.d/:/etc/nginx/conf.d/
networks:
- laranet
Note the open port in my laravel up is the same with vite config and the 8085 port points to the nginx