Skip to content

Commit 21490f9

Browse files
fix: dockerization feature
1 parent df16c7d commit 21490f9

File tree

5 files changed

+571
-540
lines changed

5 files changed

+571
-540
lines changed

.env.example

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
APP_NAME=Laravel
1+
APP_NAME=LaravelInertiaVueSpa
22
APP_ENV=local
33
APP_KEY=
44
APP_DEBUG=true
@@ -9,11 +9,11 @@ LOG_DEPRECATIONS_CHANNEL=null
99
LOG_LEVEL=debug
1010

1111
DB_CONNECTION=mysql
12-
DB_HOST=127.0.0.1
13-
DB_PORT=3306
14-
DB_DATABASE=laravel
15-
DB_USERNAME=root
16-
DB_PASSWORD=
12+
DB_HOST=mysql
13+
DB_PORT=3306
14+
DB_DATABASE=LaravelInertiaVueSpa.Database_2024!
15+
DB_USERNAME=root
16+
DB_PASSWORD=LaravelInertiaVueSpa.Password_2024!
1717

1818
BROADCAST_DRIVER=log
1919
CACHE_DRIVER=file
@@ -55,4 +55,4 @@ VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
5555
VITE_PUSHER_HOST="${PUSHER_HOST}"
5656
VITE_PUSHER_PORT="${PUSHER_PORT}"
5757
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
58-
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
58+
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

Dockerfile

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ FROM php:8.2-cli
22

33
WORKDIR /var/www/html
44

5-
# Install system dependencies
65
RUN 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
1917
RUN 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
2320
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
2421

25-
# Copy composer files and install dependencies
2622
COPY composer.json composer.lock ./
2723
RUN composer install --no-scripts --no-autoloader
2824

29-
# Copy the rest of the application files
3025
COPY . .
3126

32-
# Generate autoload files
27+
RUN npm install
28+
RUN npm run build
29+
3330
RUN 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

Comments
 (0)