@@ -2,7 +2,6 @@ FROM php:8.2-cli
22
33WORKDIR /var/www/html
44
5- # Install system dependencies
65RUN apt-get update && apt-get install -y \
76 curl \
87 libpng-dev \
@@ -15,29 +14,27 @@ RUN apt-get update && apt-get install -y \
1514 npm \
1615 && rm -rf /var/lib/apt/lists/*
1716
18- # Install PHP extensions
1917RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
2018 && docker-php-ext-install -j$(nproc) gd pdo pdo_mysql zip
2119
22- # Install Composer
2320RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
2421
25- # Copy composer files and install dependencies
2622COPY composer.json composer.lock ./
2723RUN composer install --no-scripts --no-autoloader
2824
29- # Copy the rest of the application files
3025COPY . .
3126
32- # Generate autoload files
27+ RUN npm install
28+ RUN npm run build
29+
3330RUN composer dump-autoload
3431
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
3735
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
4138
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