2023-01-21 15:50:45 +00:00
|
|
|
FROM php:8.1-fpm-bullseye AS base
|
2022-07-12 22:35:26 +00:00
|
|
|
|
2023-01-21 15:50:45 +00:00
|
|
|
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
|
|
|
RUN which composer && composer -V
|
2022-07-12 22:35:26 +00:00
|
|
|
|
2023-01-21 15:50:45 +00:00
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
ENV PATH="${PATH}:/app/vendor/bin"
|
|
|
|
|
|
|
|
COPY composer.* ./
|
|
|
|
|
|
|
|
################################################################################
|
2022-07-12 22:35:26 +00:00
|
|
|
|
|
|
|
FROM base AS build
|
|
|
|
|
2023-01-21 15:50:45 +00:00
|
|
|
RUN apt-get update -yqq \
|
|
|
|
&& apt-get install -yqq --no-install-recommends \
|
|
|
|
git libpng-dev libzip-dev mariadb-client unzip
|
|
|
|
|
|
|
|
RUN docker-php-ext-install gd pdo_mysql zip
|
|
|
|
|
|
|
|
|
|
|
|
RUN composer validate
|
|
|
|
RUN composer install
|
2022-07-12 22:35:26 +00:00
|
|
|
|
|
|
|
COPY tools/docker/images/php/root /
|
|
|
|
|
2023-01-21 15:50:45 +00:00
|
|
|
ENTRYPOINT ["/usr/local/bin/docker-entrypoint-php"]
|
|
|
|
CMD ["php-fpm"]
|
|
|
|
|
|
|
|
################################################################################
|
2022-07-12 22:35:26 +00:00
|
|
|
|
2023-01-21 15:50:45 +00:00
|
|
|
FROM base AS test
|
2022-07-12 22:35:26 +00:00
|
|
|
|
2023-01-21 15:50:45 +00:00
|
|
|
COPY . .
|
2022-07-12 22:35:26 +00:00
|
|
|
|
2023-01-21 15:50:45 +00:00
|
|
|
RUN parallel-lint src --no-progress \
|
|
|
|
&& phpcs -vv \
|
|
|
|
&& phpstan \
|
|
|
|
&& phpunit --testdox
|
2022-07-12 22:35:26 +00:00
|
|
|
|
2023-01-21 15:50:45 +00:00
|
|
|
################################################################################
|
2022-07-12 22:35:26 +00:00
|
|
|
|
2023-01-21 15:50:45 +00:00
|
|
|
FROM nginx:1 as web
|
2022-07-12 22:35:26 +00:00
|
|
|
|
2023-01-21 15:50:45 +00:00
|
|
|
EXPOSE 8080
|
2022-07-12 22:35:26 +00:00
|
|
|
|
2023-01-21 15:50:45 +00:00
|
|
|
WORKDIR /app
|
2022-07-12 22:35:26 +00:00
|
|
|
|
2023-01-21 15:50:45 +00:00
|
|
|
COPY tools/docker/images/web/root /
|