-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (28 loc) · 963 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
FROM php:8.3-fpm
WORKDIR /var/www/html
# Install required extensions and dependencies
RUN apt-get update -y && apt-get install -y \
libicu-dev \
libmariadb-dev \
unzip zip \
zlib1g-dev \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
&& docker-php-ext-install gettext intl pdo_mysql gd \
&& docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) gd
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Copy application source
COPY . .
# Install application dependencies
RUN composer install --no-scripts --no-autoloader --prefer-dist \
&& composer dump-autoload --optimize
# Set file permissions
RUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache
# Expose port 9000 and start php-fpm server
EXPOSE 9000
CMD ["php artisan migrate:fresh --seed && php-fpm"]