57 lines
1.4 KiB
Docker
57 lines
1.4 KiB
Docker
FROM composer:2 AS vendor
|
|
|
|
WORKDIR /app
|
|
COPY composer.json composer.lock ./
|
|
RUN composer install \
|
|
--no-dev \
|
|
--no-interaction \
|
|
--no-plugins \
|
|
--no-scripts \
|
|
--prefer-dist \
|
|
--optimize-autoloader \
|
|
--ignore-platform-req=php
|
|
|
|
FROM php:8.2-fpm-alpine AS app
|
|
|
|
RUN apk add --no-cache \
|
|
icu-libs \
|
|
libpng \
|
|
libjpeg-turbo \
|
|
freetype \
|
|
oniguruma \
|
|
&& apk add --no-cache --virtual .build-deps \
|
|
icu-dev \
|
|
libpng-dev \
|
|
libjpeg-turbo-dev \
|
|
freetype-dev \
|
|
oniguruma-dev \
|
|
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
|
&& docker-php-ext-install -j$(nproc) \
|
|
pdo_mysql \
|
|
mbstring \
|
|
bcmath \
|
|
opcache \
|
|
intl \
|
|
exif \
|
|
gd \
|
|
&& apk del .build-deps
|
|
|
|
COPY docker/opcache.ini /usr/local/etc/php/conf.d/opcache.ini
|
|
|
|
COPY --from=vendor /app/vendor /var/www/html/vendor
|
|
COPY . /var/www/html
|
|
|
|
RUN rm -rf /var/www/html/docker /var/www/html/.dockerignore /var/www/html/Dockerfile /var/www/html/bootstrap/cache/*.php \
|
|
&& chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache \
|
|
&& chmod -R 775 /var/www/html/storage /var/www/html/bootstrap/cache
|
|
|
|
COPY docker/entrypoint.sh /usr/local/bin/entrypoint.sh
|
|
RUN chmod +x /usr/local/bin/entrypoint.sh
|
|
|
|
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
|
CMD ["php-fpm"]
|
|
|
|
FROM nginx:alpine AS nginx
|
|
|
|
COPY conf/nginx/default.conf /etc/nginx/conf.d/default.conf
|