Skip to content

Instantly share code, notes, and snippets.

@matthewerskine
Created July 25, 2018 11:27
Show Gist options
  • Select an option

  • Save matthewerskine/30f26bd0b6abeb9796b668fc24f61604 to your computer and use it in GitHub Desktop.

Select an option

Save matthewerskine/30f26bd0b6abeb9796b668fc24f61604 to your computer and use it in GitHub Desktop.
Alpine Laravel Dockerfile
FROM php:7.2.8-fpm-alpine3.7
# Depedencies
RUN set -x \
&& mkdir -p /var/log/supervisor \
&& apk update \
&& apk add --virtual .build-deps \
alpine-sdk \
autoconf \
sudo \
&& apk add \
curl \
dcron \
freetype-dev \
libjpeg-turbo-dev \
libxml2-dev \
zlib-dev \
mysql-client \
nginx \
supervisor \
&& docker-php-source extract \
&& docker-php-ext-install \
mysqli \
pdo \
pdo_mysql \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install gd \
&& docker-php-source delete \
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer \
&& rm -rf /var/cache/apk/* /etc/apk/cache/* /etc/nginx/conf.d/default.conf \
&& mkdir -p /var/www/html \
&& apk del .build-deps
# Supervisor
COPY ./supervisor/conf.d/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Nginx
COPY ./nginx/sites-available/site.conf /etc/nginx/sites-available/site.conf
COPY ./nginx/nginx.conf /etc/nginx/nginx.conf
# Project
WORKDIR /var/www/html
EXPOSE 80 445 9000
ENTRYPOINT ["supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment