-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (23 loc) · 934 Bytes
/
Dockerfile
File metadata and controls
31 lines (23 loc) · 934 Bytes
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
# PHP 8.2 Alpine for Performance Bundle (dev and tests; includes pdo_mysql/pdo_pgsql for integration tests)
FROM php:8.2-cli-alpine
RUN apk add --no-cache \
git \
unzip \
bash \
libzip-dev \
postgresql-dev
RUN docker-php-ext-install -j$(nproc) zip pdo pdo_mysql pdo_pgsql
# PCOV for code coverage
RUN apk add --no-cache $PHPIZE_DEPS \
&& pecl install pcov \
&& docker-php-ext-enable pcov \
&& apk del $PHPIZE_DEPS
# Install Composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
# Copy composer files (lock optional so build works when lock is out of date)
COPY composer.json composer.lock* ./
# Install dependencies; if lock is invalid, update to resolve
RUN composer install --no-interaction --prefer-dist --optimize-autoloader || composer update --no-interaction --prefer-dist --optimize-autoloader
WORKDIR /app
ENV COMPOSER_ALLOW_SUPERUSER=1
ENV PATH="/app/vendor/bin:${PATH}"