docker-example-drupal/Dockerfile

51 lines
998 B
Docker
Raw Normal View History

2023-01-21 15:50:45 +00:00
FROM php:8.1-fpm-bullseye AS base
2023-01-21 15:50:45 +00:00
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
RUN which composer && composer -V
2023-01-21 15:50:45 +00:00
WORKDIR /app
ENV PATH="${PATH}:/app/vendor/bin"
COPY composer.* ./
################################################################################
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
COPY tools/docker/images/php/root /
2023-01-21 15:50:45 +00:00
ENTRYPOINT ["/usr/local/bin/docker-entrypoint-php"]
CMD ["php-fpm"]
################################################################################
2023-01-21 15:50:45 +00:00
FROM base AS test
2023-01-21 15:50:45 +00:00
COPY . .
2023-01-21 15:50:45 +00:00
RUN parallel-lint src --no-progress \
&& phpcs -vv \
&& phpstan \
&& phpunit --testdox
2023-01-21 15:50:45 +00:00
################################################################################
2023-01-21 15:50:45 +00:00
FROM nginx:1 as web
2023-01-21 15:50:45 +00:00
EXPOSE 8080
2023-01-21 15:50:45 +00:00
WORKDIR /app
2023-01-21 15:50:45 +00:00
COPY tools/docker/images/web/root /