Skip to content

Instantly share code, notes, and snippets.

@mossey
Created May 7, 2019 18:10
Show Gist options
  • Save mossey/69254b0305abf5625f4176677dc5111b to your computer and use it in GitHub Desktop.
Save mossey/69254b0305abf5625f4176677dc5111b to your computer and use it in GitHub Desktop.
Laravel docker file
FROM php:7-fpm-alpine
RUN apk --update add wget \
curl \
git \
grep \
nginx \
build-base \
libmemcached-dev \
libmcrypt-dev \
libxml2-dev \
zlib-dev \
autoconf \
cyrus-sasl-dev \
libgsasl-dev \
supervisor
RUN docker-php-ext-install mysqli mbstring pdo pdo_mysql tokenizer xml bcmath
RUN pecl channel-update pecl.php.net && pecl install memcached && docker-php-ext-enable memcached
RUN curl -sS -k --insecure https://getcomposer.org/installer | php && chmod +x composer.phar && mv composer.phar /usr/local/bin/composer
RUN rm /var/cache/apk/* && \
mkdir -p /var/www
RUN docker-php-ext-install sockets
# Install all PHP dependencies
COPY . /var/www/html
RUN touch .env
RUN composer install --no-interaction
COPY nginx.conf /etc/nginx/nginx.conf
COPY supervisord.conf /etc/supervisord.conf
RUN chmod 755 -R .
RUN chmod -R o+w storage
RUN php artisan key:generate
ENTRYPOINT ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisord.conf"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment