Skip to content

Instantly share code, notes, and snippets.

@jlem
Created February 1, 2020 15:02
Show Gist options
  • Save jlem/2cb96e0ee3cd48f12bc37e346017c391 to your computer and use it in GitHub Desktop.
Save jlem/2cb96e0ee3cd48f12bc37e346017c391 to your computer and use it in GitHub Desktop.
Laravel Docker base image
FROM php:7.4-fpm
# Install dependencies
RUN apt-get update && apt-get install -y \
zlib1g-dev \
libxml2-dev \
libzip-dev \
libonig-dev \
unzip
# PHP Extensions
RUN docker-php-ext-install zip pdo pdo_mysql opcache \
&& docker-php-ext-configure opcache --enable-opcache \
&& docker-php-source delete
# PHP XDebug
RUN pecl install xdebug \
&& docker-php-ext-enable xdebug \
&& echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
# Install Composer & Laravel
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN composer global require laravel/installer
ENV PATH "$PATH:~/.composer/vendor/bin"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment