Created
November 15, 2020 08:55
-
-
Save vchakoshy/f26f817fc04aeda4cab38d025b46571d to your computer and use it in GitHub Desktop.
laravel production ready docker file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ARG PHP_EXTENSIONS="apcu bcmath opcache pcntl pdo_mysql redis zip sockets imagick gd exif soap remoteip json" | |
ARG APACHE_EXTENSIONS="remoteip" | |
FROM thecodingmachine/php:7.4-v3-apache as php_base | |
ENV TEMPLATE_PHP_INI=production | |
ENV APACHE_EXTENSION_REMOTEIP=1 | |
ENV PHP_EXTENSION_GD=1 | |
ENV PHP_INI_MEMORY_LIMIT=1g | |
ENV PHP_INI_MAX_EXECUTION_TIME=300 | |
WORKDIR /var/www/html | |
COPY --chown=docker:docker . . | |
RUN composer install --quiet --optimize-autoloader --no-dev | |
FROM node:10 as node_dependencies | |
WORKDIR /var/www/html | |
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=false | |
COPY --from=php_base /var/www/html/package.json . | |
COPY --from=php_base /var/www/html/package-lock.json . | |
RUN npm set progress=false && \ | |
npm config set depth 0 && \ | |
npm install | |
COPY --from=php_base /var/www/html /var/www/html | |
RUN npm run prod && rm -rf node_modules | |
FROM php_base | |
ENV APACHE_DOCUMENT_ROOT=/var/www/html/public | |
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