Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a PHPFPM alpine based service #960

Closed
ghost opened this issue May 20, 2017 · 2 comments
Closed

Provide a PHPFPM alpine based service #960

ghost opened this issue May 20, 2017 · 2 comments
Labels

Comments

@ghost
Copy link

ghost commented May 20, 2017

I converted an existing fpm dockerfile to the alpine distro earlier and it dropped the image size from 170mb down to 50mb. This is a naive first attempt and by no means is optimised but certainly is a step in the right direction, the only issue is my fpm image was forked from the laradock image a while back so is likely out of sync and I dont have enough time to bring it up to speed with your own. In theory you should be able to just the optional software section to the below:

FROM php:7.1-fpm-alpine

#
#--------------------------------------------------------------------------
# Software's Installation
#--------------------------------------------------------------------------

RUN apk --repository http://dl-3.alpinelinux.org/alpine/edge/community/ \
    --repository http://dl-3.alpinelinux.org/alpine/edge/main/ \
    --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ \
    --update \
    add bash \
    shadow \
    curl \
    zlib-dev \
    postgresql-dev \
    libjpeg-turbo-dev \
    libpng-dev \
    freetype-dev \
    openssl-dev \
    libmcrypt-dev \
    && docker-php-ext-install mcrypt pdo_mysql pdo_pgsql \
    && docker-php-ext-configure gd \
    --enable-gd-native-ttf \
    --with-png-dir=/usr/include/ \
    --with-jpeg-dir=/usr/include/ \
    --with-freetype-dir=/usr/include/ \
    && docker-php-ext-install gd \
    && apk del --purge make g++ autoconf libtool && \
    rm -rf /var/cache/apk/*

<<Insert Optional Software Here >>

#####################################
# COMPOSER:
#####################################

# Install composer and add its bin to the PATH.
RUN curl -s http://getcomposer.org/installer | php && \
    echo "export PATH=${PATH}:/var/www/vendor/bin" >> ~/.bashrc && \
    mv composer.phar /usr/local/bin/composer

# Source the bash
RUN . ~/.bashrc


#--------------------------------------------------------------------------
# Final Touch
#--------------------------------------------------------------------------


ADD ./laravel.ini /usr/local/etc/php/conf.d
ADD ./laravel.pool.conf /usr/local/etc/php-fpm.d/

RUN usermod -u 1000 www-data

WORKDIR /var/www

CMD ["php-fpm"]
@stale
Copy link

stale bot commented Feb 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale label Feb 2, 2020
@stale
Copy link

stale bot commented Feb 23, 2020

Hi again 👋 we would like to inform you that this issue has been automatically closed 🔒 because it had not recent activity during the stale period. We really really appreciate your contributions, and looking forward for more in the future 🎈.

@stale stale bot closed this as completed Feb 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

0 participants