Skip to content

Instantly share code, notes, and snippets.

@oceanapplications
Created July 21, 2021 22:08
Show Gist options
  • Save oceanapplications/7a360663fcd79878abdade68dfed5c5b to your computer and use it in GitHub Desktop.
Save oceanapplications/7a360663fcd79878abdade68dfed5c5b to your computer and use it in GitHub Desktop.
ARG PHP_EXTENSIONS="apcu bcmath pdo_mysql redis imagick gd"
FROM thecodingmachine/php:8.0-v4-fpm as php_base
ENV TEMPLATE_PHP_INI=production
#copy our laravel application to html
COPY --chown=docker:docker . /var/www/html
RUN composer install --quiet --optimize-autoloader --no-dev
FROM node:14 as node_dependencies
WORKDIR /var/www/html
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=false
#bring in the laravel application from the php_base to our node js container
COPY --from=php_base /var/www/html /var/www/html
RUN npm set progress=false && \
npm config set depth 0 && \
npm install && \
npm run prod && \
rm -rf node_modules
FROM php_base
#bring the finished build back into the php container
COPY --from=node_dependencies --chown=docker:docker /var/www/html /var/www/html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment