-
Notifications
You must be signed in to change notification settings - Fork 0
/
dockerfile
45 lines (34 loc) · 1011 Bytes
/
dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Dockerfile
FROM php:8.2-fpm
# Install dependencies
RUN apt-get update && apt-get install -y \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
git \
unzip \
curl \
nodejs \
npm \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install gd pdo pdo_mysql
# Set working directory
WORKDIR /var/www
# Copy existing application directory
COPY . .
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Install Laravel dependencies
RUN composer install --no-interaction
# Install React (Inertia) dependencies
RUN npm install
# Build the React application
RUN npm run build
# Set permissions
RUN chown -R www-data:www-data /var/www/storage /var/www/bootstrap/cache
# Run migrations and seeders
RUN php artisan migrate:reset && php artisan migrate --force && php artisan db:seed --force
# Expose port
EXPOSE 8000
# Start the Laravel application
CMD ["php", "artisan", "serve", "--host=0.0.0.0", "--port=8000"]