Skip to content

Instantly share code, notes, and snippets.

@duskohu
Last active June 1, 2020 12:48
Show Gist options
  • Save duskohu/ca7e5adc4d0af66d478de41766f04b6f to your computer and use it in GitHub Desktop.
Save duskohu/ca7e5adc4d0af66d478de41766f04b6f to your computer and use it in GitHub Desktop.
Dockerfiles
FROM php:7.1-fpm-alpine
LABEL maintainer="Dusan Hudak <admin@dusan-hudak.com>"
RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ --allow-untrusted gnu-libiconv
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
# install GD
RUN apk add --no-cache freetype libpng libjpeg-turbo freetype-dev libpng-dev libjpeg-turbo-dev && \
docker-php-ext-configure gd \
--with-gd \
--with-freetype-dir=/usr/include/ \
--with-png-dir=/usr/include/ \
--with-jpeg-dir=/usr/include/ && \
NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && \
docker-php-ext-install -j${NPROC} gd && \
apk del --no-cache freetype-dev libpng-dev libjpeg-turbo-dev
# other
RUN docker-php-ext-install \
mysqli \
pdo \
pdo_mysql
RUN echo http://dl-2.alpinelinux.org/alpine/edge/community/ >> /etc/apk/repositories
RUN apk --no-cache add shadow && usermod -u 1000 www-data
RUN apk add --no-cache git composer && \
rm -rf /tmp/* /usr/local/lib/php/doc/* /var/cache/apk/*
FROM nginx:stable-alpine
LABEL maintainer="Dusan Hudak <admin@dusan-hudak.com>"
RUN echo http://dl-2.alpinelinux.org/alpine/edge/community/ >> /etc/apk/repositories
RUN apk --no-cache add shadow && usermod -u 1000 nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment