baleen/docker/php/Dockerfile

24 lines
539 B
Docker
Raw Permalink Normal View History

FROM composer:lts AS build
WORKDIR /var/www/html
COPY composer.json .
COPY composer.lock .
RUN --mount=type=bind,source=composer.json,target=composer.json \
--mount=type=bind,source=composer.lock,target=composer.lock \
--mount=type=cache,target=/tmp/cache \
composer install --no-dev --no-interaction
FROM php:8.3-fpm AS run
ARG DB_CONNECTION
WORKDIR /var/www/html
RUN apt-get update && apt-get install -y \
libpq-dev
RUN docker-php-ext-install pdo_pgsql
COPY --from=build /var/www/html/vendor /var/www/html/vendor