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
2
2
3
3
WORKDIR /var/www/html
4
4
5
+ # Install system dependencies
5
6
RUN apt-get update && apt-get install -y \
6
7
curl \
7
8
libpng-dev \
@@ -11,30 +12,32 @@ RUN apt-get update && apt-get install -y \
11
12
zip \
12
13
unzip \
13
14
nodejs \
14
- npm
15
+ npm \
16
+ && rm -rf /var/lib/apt/lists/*
15
17
18
+ # Install PHP extensions
16
19
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
17
20
&& docker-php-ext-install -j$(nproc) gd pdo pdo_mysql zip
18
21
22
+ # Install Composer
19
23
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
20
24
25
+ # Copy composer files and install dependencies
21
26
COPY composer.json composer.lock ./
22
-
23
27
RUN composer install --no-scripts --no-autoloader
24
28
29
+ # Copy the rest of the application files
25
30
COPY . .
26
31
32
+ # Generate autoload files
27
33
RUN composer dump-autoload
28
34
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
36
37
38
+ # Expose ports for both PHP and npm servers
37
39
EXPOSE 9000
40
+ EXPOSE 5173
38
41
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 1
1
{
2
2
"private" : true ,
3
3
"scripts" : {
4
- "dev" : " vite" ,
4
+ "dev" : " vite --host " ,
5
5
"build" : " vite build"
6
6
},
7
7
"devDependencies" : {
Original file line number Diff line number Diff line change @@ -3,6 +3,15 @@ import laravel from 'laravel-vite-plugin';
3
3
import vue from '@vitejs/plugin-vue' ;
4
4
5
5
export default defineConfig ( {
6
+ server : {
7
+ host : '0.0.0.0' ,
8
+ hmr : {
9
+ host : 'localhost' ,
10
+ } ,
11
+ watch : {
12
+ usePolling : true
13
+ }
14
+ } ,
6
15
plugins : [
7
16
laravel ( {
8
17
input : 'resources/js/app.js' ,
You can’t perform that action at this time.
0 commit comments