Skip to content

Instantly share code, notes, and snippets.

@kunthar
Created September 28, 2021 11:50
Show Gist options
  • Save kunthar/3ba5d0b7e7fec4985ec78975b3de6cf0 to your computer and use it in GitHub Desktop.
Save kunthar/3ba5d0b7e7fec4985ec78975b3de6cf0 to your computer and use it in GitHub Desktop.
php-fpm with goodies
FROM php:fpm-alpine3.14
WORKDIR /var/www/html/
# Date time setup
RUN apk add tzdata
RUN cp /usr/share/zoneinfo/Europe/Istanbul /etc/localtime
RUN echo "Europe/Istanbul" > /etc/timezone
RUN apk del tzdata
#Set shell locale
ENV LANG=en_US.UTF-8 \
LANGUAGE=en_US.UTF-8
# Essentials
RUN apk add --no-cache vim zip git unzip curl sqlite
# Installing bash
RUN apk add bash
RUN sed -i 's/bin\/ash/bin\/bash/g' /etc/passwd
# Installing PHP extensions
RUN apk --update add php \
php-common \
php-bcmath \
php-ctype \
php-curl \
php-fpm \
php-gd \
php-iconv \
php-intl \
php-json \
php-mbstring \
php-mysqlnd \
php-opcache \
php-openssl \
php-pdo \
php-pdo_mysql \
php-pdo_pgsql \
php-pdo_sqlite \
php-phar \
php-posix \
php-session \
php-soap \
php-xml \
php-xmlwriter \
php-simplexml \
php-tokenizer \
php7-pecl-redis \
php-xml \
php-openssl \
php-cli \
php-dom \
php-fileinfo \
php-zip
# Installing composer
RUN curl -sS https://getcomposer.org/installer -o composer-setup.php
RUN php composer-setup.php --install-dir=/usr/local/bin --filename=composer
RUN rm -rf composer-setup.php
RUN rm -rf /var/cache/apk/* \
&& rm -rf /tmp/*
# https://hub.docker.com/layers/php/library/php/fpm-alpine3.14/images/sha256-d734cbc3284aa0dff8cf6abdff750fdb2da854361d728c11cd26a11b40f4a99a?context=explore
ENTRYPOINT ["docker-php-entrypoint"]
WORKDIR /var/www/html
# /bin/sh -c set -eux; cd
STOPSIGNAL SIGQUIT
EXPOSE 9000
CMD ["php-fpm"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment