Building a LEMP environment

1 post / 0 new
#1 Tue, 2016-10-25 10:35
bertalanimre
  • bertalanimre's picture
  • Offline
  • Last seen: 1 year 5 months ago
  • Joined: 2016-10-25

Hello Forum,

I wish to use your help in creating a docker image for myself. I'm trying to get a lemp looking environment (NginX, PHP, MySQL) but without mysql (only the client is required) and php-fpm including two dozen modules. I've managed to install it on CentOS6 docker image, but that became huge, around 800MB. I don't know mutch about Alpine Linux, only that it is damn small. Can you guys help me write a Dockerfile with the package listed in my original Dockerfile? I would appreciate that.

# CentOS 6 system with NginX, PHP-FPM 5.6 and MySQL 5.7 client installed
 
FROM centos:centos6
 
MAINTAINER Bertalan Imre - <script type="text/javascript">
<!--//--><![CDATA[// ><!--
eval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%62%65%72%74%61%6c%61%6e%69%6d%72%65%40%67%6d%61%69%6c%2e%63%6f%6d%22%3e%62%65%72%74%61%6c%61%6e%69%6d%72%65%40%67%6d%61%69%6c%2e%63%6f%6d%3c%2f%61%3e%27%29%3b'))
//--><!]]>
</script>
 
RUN yum install vim initscripts wget -y && yum install epel-release -y && yum install nginx -y && yes | rpm -Uvh <a href="https://mirror.webtatic.com/yum/el6/latest.rpm
 
RUN" rel="nofollow">https://mirror.webtatic.com/yum/el6/latest.rpm
 
RUN</a> yum install php56w php56w-fpm php56w-opcache php56w-devel php56w-mbstring php56w-common php56w-opcache php56w-pecl-apcu php56w-cli php56w-pear php56w-pdo php56w-mysqlnd php56w-pgsql php56w-pecl-memcache php56w-pecl-memcached php56w-gd php56w-mcrypt php56w-xml -y
 
RUN wget <a href="http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm" rel="nofollow">http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm</a> && yum localinstall mysql57-community-release-el6-7.noarch.rpm -y && yum install mysql-community-client npm libpng-dev libnotify -y && cd /tmp && curl -sS <a href="https://getcomposer.org/installer" rel="nofollow">https://getcomposer.org/installer</a> | php && mv composer.phar /usr/local/bin/composer
 
RUN echo "daemon off;" >> /etc/nginx/nginx.conf

So the must have packages are:

  • nginx
  • mysql-community-client
  • php56
  • php56-fpm
  • php56-opcache
  • php56-devel
  • php56-mbstring
  • php56-common
  • php56-opcache
  • php56-pecl-apcu
  • php56-cli
  • php56-pear
  • php56-pdo
  • php56-mysqlnd
  • php56-pgsql
  • php56-pecl-memcache
  • php56-pecl-memcached
  • php56-gd
  • php56-mcrypt
  • php56-xml
  • composer

Thank you in advance!