Skip to content

Instantly share code, notes, and snippets.

@mkhmylife
Last active July 8, 2019 16:18
Show Gist options
  • Save mkhmylife/cb58ecfdc2e5e591f201a0422bb0222a to your computer and use it in GitHub Desktop.
Save mkhmylife/cb58ecfdc2e5e591f201a0422bb0222a to your computer and use it in GitHub Desktop.
Laravel Mult-Arch Dockerfile
ARG PHP_EXTENSIONS="apcu bcmath opcache pcntl pdo_mysql redis zip sockets imagick gd exif"
FROM hyperair/php:7.3-v2-slim-apache
ENV TEMPLATE_PHP_INI=production \
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=false \
APP_ENV=prod \
APACHE_DOCUMENT_ROOT=/public
# For some reasons I can't get optipng pngquant to compile on Arm64
# USER root
# RUN rm -rf /var/lib/apt/lists/* && \
# apt-get update && \
# curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
# apt-get update && \
# apt-get install -y --no-install-recommends nodejs libpng-dev && \
# npm install -g npm gifsicle mozjpeg optipng pngquant --unsafe-perm=true --allow-root && \
# apt-get clean autoclean && \
# apt-get autoremove --yes && \
# rm -rf /var/lib/{apt,dpkg,cache,log}/
USER docker
COPY --chown=docker:docker . /var/www/html
RUN composer install --quiet --optimize-autoloader --no-dev
RUN npm set progress=false && \
npm config set depth 0 && \
npm install && \
npm run prod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment