File tree Expand file tree Collapse file tree 3 files changed +24
-12
lines changed Expand file tree Collapse file tree 3 files changed +24
-12
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ FROM php:8.2-cli
22
33WORKDIR /var/www/html
44
5+ # Install system dependencies
56RUN apt-get update && apt-get install -y \
67 curl \
78 libpng-dev \
@@ -11,30 +12,32 @@ RUN apt-get update && apt-get install -y \
1112 zip \
1213 unzip \
1314 nodejs \
14- npm
15+ npm \
16+ && rm -rf /var/lib/apt/lists/*
1517
18+ # Install PHP extensions
1619RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
1720 && docker-php-ext-install -j$(nproc) gd pdo pdo_mysql zip
1821
22+ # Install Composer
1923RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
2024
25+ # Copy composer files and install dependencies
2126COPY composer.json composer.lock ./
22-
2327RUN composer install --no-scripts --no-autoloader
2428
29+ # Copy the rest of the application files
2530COPY . .
2631
32+ # Generate autoload files
2733RUN composer dump-autoload
2834
29- RUN apt-get update && apt-get install -y \
30- nodejs \
31- npm
32-
33- RUN npm install
34-
35- RUN php artisan config:clear
35+ # Install npm packages and build
36+ RUN npm install && npm run build
3637
38+ # Expose ports for both PHP and npm servers
3739EXPOSE 9000
40+ EXPOSE 5173
3841
39- CMD php artisan serve --host=0.0.0.0 --port=9000
40-
42+ # Set up command to run both services
43+ CMD php artisan serve --host=0.0.0.0 --port=9000 & npm run dev --host 0.0.0.0 --port 5173
Original file line number Diff line number Diff line change 11{
22 "private" : true ,
33 "scripts" : {
4- "dev" : " vite" ,
4+ "dev" : " vite --host " ,
55 "build" : " vite build"
66 },
77 "devDependencies" : {
Original file line number Diff line number Diff line change @@ -3,6 +3,15 @@ import laravel from 'laravel-vite-plugin';
33import vue from '@vitejs/plugin-vue' ;
44
55export default defineConfig ( {
6+ server : {
7+ host : '0.0.0.0' ,
8+ hmr : {
9+ host : 'localhost' ,
10+ } ,
11+ watch : {
12+ usePolling : true
13+ }
14+ } ,
615 plugins : [
716 laravel ( {
817 input : 'resources/js/app.js' ,
You can’t perform that action at this time.
0 commit comments