Newer
Older
FROM --platform=$BUILDPLATFORM public.ecr.aws/docker/library/node:22.9-alpine@sha256:bec402741e59b7f74ddf1b78bff2013c178bebd3b5cf841c202d376d5f1d738a AS buildJS
WORKDIR /app
COPY . ./
RUN yarn install --frozen-lockfile && \
yarn build
FROM --platform=$BUILDPLATFORM public.ecr.aws/docker/library/composer:2.7.9@sha256:8008ba4d8723edf5f3566bd94e9330a5cdff3d6125ed34a8502718f8d2289515 AS buildPHP
WORKDIR /app
COPY . ./
RUN composer install --no-cache --no-interaction --prefer-dist --ignore-platform-reqs --optimize-autoloader
FROM jonasled.dev/jonasled/nginx-php-minimal:82-3.18 as production
COPY . .
COPY --from=buildJS /app/public/build/ ./public/build/
COPY --from=buildPHP /app/vendor/ ./vendor/
COPY --from=buildPHP /app/public/ ./public/
COPY ./vhost.conf /etc/nginx/http.d/default.conf
RUN rm -rf ./var && \
mkdir -p ./var/cache ./var/log && \
chown nginx:nginx . -R && \
apk add php${PHP_VERSION}-ctype php${PHP_VERSION}-dom php${PHP_VERSION}-tokenizer php${PHP_VERSION}-mbstring php${PHP_VERSION}-pdo php${PHP_VERSION}-pdo_mysql php${PHP_VERSION}-simplexml php${PHP_VERSION}-gd php${PHP_VERSION}-cli && \
rm -rf /var/cache/apk/* && \
sed -i "s|;clear_env = no|clear_env = no|g" /etc/php${PHP_VERSION}/php-fpm.d/www.conf