@@ -2,7 +2,6 @@ FROM php:8.2-cli
2
2
3
3
WORKDIR /var/www/html
4
4
5
- # Install system dependencies
6
5
RUN apt-get update && apt-get install -y \
7
6
curl \
8
7
libpng-dev \
@@ -15,29 +14,27 @@ RUN apt-get update && apt-get install -y \
15
14
npm \
16
15
&& rm -rf /var/lib/apt/lists/*
17
16
18
- # Install PHP extensions
19
17
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
20
18
&& docker-php-ext-install -j$(nproc) gd pdo pdo_mysql zip
21
19
22
- # Install Composer
23
20
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
24
21
25
- # Copy composer files and install dependencies
26
22
COPY composer.json composer.lock ./
27
23
RUN composer install --no-scripts --no-autoloader
28
24
29
- # Copy the rest of the application files
30
25
COPY . .
31
26
32
- # Generate autoload files
27
+ RUN npm install
28
+ RUN npm run build
29
+
33
30
RUN composer dump-autoload
34
31
35
- # Install npm packages and build
36
- RUN npm install && npm run build
32
+ RUN php artisan storage:link
33
+
34
+ RUN php artisan key:generate
37
35
38
- # Expose ports for both PHP and npm servers
39
- EXPOSE 9000
40
- EXPOSE 5173
36
+ # Expose ports for PHP server and frontend
37
+ EXPOSE 9000 3000
41
38
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
39
+ # Set up command to run both PHP server and frontend
40
+ CMD php artisan serve --host=0.0.0.0 --port=9000 & npm run dev -- --host
0 commit comments