Last active
January 5, 2016 10:02
-
-
Save f1r3starter/d89a9c5b7d3a0c5dfefd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fpmorakul: | |
build: ./php-fpm | |
links: | |
- memcached | |
fpmtaro: | |
build: ./php-fpm | |
links: | |
- memcached | |
memcached: | |
build: ./memcached | |
nginx777: | |
build: ./nginx | |
links: | |
- fpmorakul | |
- fpmtaro | |
ports: | |
- 80:80 | |
volumes: | |
- /etc/nginx:/etc/nginx | |
- /var/tmp/nginx-tmpfs:/var/tmp/nginx-tmpfs | |
- /var/log/nginx:/var/log/nginx | |
- /var/www/html:/var/www/html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:14.04 | |
RUN apt-get update | |
RUN apt-get install -y memcached | |
EXPOSE 11211 | |
CMD ["-m", "64"] | |
USER daemon | |
ENTRYPOINT memcached |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:14.04 | |
ENV VER_NGINX_DEVEL_KIT=0.2.19 | |
ENV VER_LUA_NGINX_MODULE=0.9.16 | |
ENV VER_NGINX=1.9.3 | |
ENV VER_LUAJIT=2.0.4 | |
ENV NGINX_DEVEL_KIT ngx_devel_kit-${VER_NGINX_DEVEL_KIT} | |
ENV LUA_NGINX_MODULE lua-nginx-module-${VER_LUA_NGINX_MODULE} | |
ENV NGINX_ROOT=/nginx | |
#RUN mkdir /var/www/html | |
ENV WEB_DIR /var/www/html | |
RUN mkdir /var/tmp/nginx-tmpfs | |
ENV LUAJIT_LIB /usr/local/lib | |
ENV LUAJIT_INC /usr/local/include/luajit-2.0 | |
RUN apt-get -qq update | |
RUN apt-get -qq -y install wget | |
# BUILD DEPENDENCIES | |
# Common dependencies (Nginx and LUAJit) | |
RUN apt-get -qq -y install make | |
# Nginx dependencies | |
RUN apt-get -qq -y install libpcre3 | |
RUN apt-get -qq -y install libpcre3-dev | |
RUN apt-get -qq -y install zlib1g-dev | |
RUN apt-get -qq -y install libssl-dev | |
# LUAJit dependencies | |
RUN apt-get -qq -y install gcc | |
# DOWNLOAD AND UNTAR | |
# Download | |
RUN wget http://nginx.org/download/nginx-${VER_NGINX}.tar.gz | |
RUN wget http://luajit.org/download/LuaJIT-${VER_LUAJIT}.tar.gz | |
RUN wget https://github.com/simpl/ngx_devel_kit/archive/v${VER_NGINX_DEVEL_KIT}.tar.gz -O ${NGINX_DEVEL_KIT}.tar.gz | |
RUN wget https://github.com/openresty/lua-nginx-module/archive/v${VER_LUA_NGINX_MODULE}.tar.gz -O ${LUA_NGINX_MODULE}.tar.gz | |
# Untar | |
RUN tar -xzvf nginx-${VER_NGINX}.tar.gz && rm nginx-${VER_NGINX}.tar.gz | |
RUN tar -xzvf LuaJIT-${VER_LUAJIT}.tar.gz && rm LuaJIT-${VER_LUAJIT}.tar.gz | |
RUN tar -xzvf ${NGINX_DEVEL_KIT}.tar.gz && rm ${NGINX_DEVEL_KIT}.tar.gz | |
RUN tar -xzvf ${LUA_NGINX_MODULE}.tar.gz && rm ${LUA_NGINX_MODULE}.tar.gz | |
# BUILD FROM SOURCE | |
# LuaJIT | |
WORKDIR /LuaJIT-${VER_LUAJIT} | |
RUN make | |
RUN make install | |
# Nginx with LuaJIT | |
WORKDIR /nginx-${VER_NGINX} | |
RUN ./configure \ | |
--prefix=${NGINX_ROOT} \ | |
--with-ld-opt="-Wl,-rpath,${LUAJIT_LIB}" \ | |
--add-module=/${NGINX_DEVEL_KIT} \ | |
--add-module=/${LUA_NGINX_MODULE} \ | |
--with-pcre \ | |
--conf-path=/etc/nginx/nginx.conf \ | |
--error-log-path=/var/log/nginx/error.log \ | |
--http-client-body-temp-path=/var/lib/nginx/body \ | |
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \ | |
--http-log-path=/var/log/nginx/access.log \ | |
--http-proxy-temp-path=/var/lib/nginx/proxy \ | |
--with-http_gzip_static_module \ | |
--lock-path=/var/lock/nginx.lock \ | |
--pid-path=/run/nginx.pid \ | |
--with-http_gunzip_module \ | |
--with-http_realip_module \ | |
--with-http_stub_status_module \ | |
--with-http_spdy_module \ | |
--with-http_ssl_module | |
RUN make -j2 | |
RUN make install | |
RUN ln -s ${NGINX_ROOT}/sbin/nginx /usr/local/sbin/nginx | |
# MISC | |
WORKDIR ${WEB_DIR} | |
EXPOSE 80 | |
EXPOSE 443 | |
RUN mkdir -p /var/lib/nginx/body | |
RUN mkdir -p /var/lib/nginx/proxy | |
RUN mkdir -p /var/lib/nginx/fastcgi | |
# CLEANUP | |
RUN rm -rf /nginx-${VER_NGINX} | |
RUN rm -rf /LuaJIT-${VER_LUAJIT} | |
RUN rm -rf /${NGINX_DEVEL_KIT} | |
RUN rm -rf /${LUA_NGINX_MODULE} | |
# TODO: Uninstall build only dependencies? | |
# TODO: Remove env vars used only for build? | |
# This is the default CMD used by nginx:1.9.2 image | |
CMD ["nginx", "-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:5.6-fpm | |
RUN apt-get update | |
RUN apt-get install -y php5-dev php-pear php5-common | |
# curl уже входит в образ 5.6-fpm но на всякие пожарные попробуем установить | |
RUN apt-get install -y curl libcurl4-openssl-dev | |
RUN docker-php-ext-install curl | |
RUN docker-php-ext-enable curl | |
# Устанавливаем все расширения | |
RUN docker-php-ext-install json | |
RUN docker-php-ext-enable json | |
RUN apt-get install -y libpng-dev | |
RUN apt-get install -y libjpeg-dev | |
RUN docker-php-ext-install gd | |
RUN docker-php-ext-enable gd | |
RUN apt-get install -y libxml2-dev | |
RUN docker-php-ext-install xml | |
RUN docker-php-ext-enable xml | |
RUN docker-php-ext-install opcache | |
RUN docker-php-ext-enable opcache | |
RUN docker-php-ext-install session | |
RUN docker-php-ext-enable session | |
RUN docker-php-ext-install mbstring | |
RUN docker-php-ext-enable mbstring | |
RUN docker-php-ext-install mysqli | |
RUN docker-php-ext-enable mysqli | |
RUN docker-php-ext-install pdo | |
RUN docker-php-ext-enable pdo | |
RUN docker-php-ext-install pdo_mysql | |
RUN docker-php-ext-enable pdo_mysql | |
RUN apt-get install -y libpq-dev | |
RUN docker-php-ext-install pdo_pgsql | |
RUN docker-php-ext-enable pdo_pgsql | |
RUN apt-get install -y php5-memcached | |
RUN pecl install redis | |
RUN docker-php-ext-enable redis | |
RUN docker-php-ext-install pcntl | |
RUN docker-php-ext-enable pcntl | |
# Настройка xDebug (КЭП) | |
RUN pecl install xdebug-2.3.2 | |
RUN docker-php-ext-enable xdebug | |
RUN touch /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini | |
RUN echo xdebug.remote_autostart=true >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini | |
RUN echo xdebug.remote_mode=req >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini | |
RUN echo xdebug.remote_handler=dbgp >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini | |
RUN echo xdebug.remote_connect_back=1 >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini | |
RUN echo xdebug.remote_port=9000 >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini | |
# RUN echo xdebug.remote_host=127.0.0.1 >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini | |
RUN echo xdebug.idekey=PHPSTORM >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini | |
RUN echo xdebug.remote_enable=1 >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini | |
RUN echo xdebug.profiler_append=0 >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini | |
RUN echo xdebug.profiler_enable=0 >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini | |
RUN echo xdebug.profiler_enable_trigger=1 >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini | |
RUN echo xdebug.profiler_output_dir=/var/debug >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini | |
RUN echo xdebug.profiler_output_name=cachegrind.out.%s.%u >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini | |
RUN echo xdebug.var_display_max_data=-1 >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini | |
RUN echo xdebug.var_display_max_children=-1 >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini | |
RUN echo xdebug.var_display_max_depth=-1 >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini | |
RUN apt-get install -y geoip-bin geoip-database libgeoip-dev | |
RUN apt-get install -y php5-geoip | |
RUN apt-get install -y wget | |
RUN wget https://phar.phpunit.de/phpunit.phar | |
RUN chmod +x phpunit.phar | |
RUN mv phpunit.phar /usr/local/bin/phpunit | |
WORKDIR /var/www | |
CMD ["php-fpm"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment