From 4c23c9244d3f62b5cb48f2e0310c9dab30e836f2 Mon Sep 17 00:00:00 2001 From: roquie Date: Sat, 16 Jun 2018 09:10:20 +0300 Subject: [PATCH] Reduced size on Docker image and speed up of start container. --- Dockerfile | 7 +++---- README.md | 2 ++ conf/nginx/nginx.conf.tmpl | 1 - conf/start.sh | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index a27fd74..718e4b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,6 @@ RUN apt-get update \ git \ make \ gettext-base \ - python-setuptools \ nginx=${NGINX_VERSION} \ php7.2-fpm \ php7.2-cli \ @@ -35,21 +34,21 @@ RUN apt-get update \ php7.2-intl \ php7.2-xml \ php7.2-redis \ - && easy_install supervisor supervisor-stdout \ && echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d \ && git clone https://github.com/ztombol/varrick.git \ && cd varrick; make -i install; cd ..; rm -rf varrick \ - && apt-get purge -y git make \ && chown -R nginx:nginx /etc/nginx /etc/php/7.2/fpm \ && rm -rf /etc/nginx/conf.d/default.conf \ && rm /usr/share/nginx/html/* \ + && apt-get purge -y git make python python3; apt-get autoremove -y \ && apt-get clean && rm -rf /var/lib/apt/lists/* -ADD conf/supervisord.conf /etc/supervisord.conf ADD conf/nginx/* /etc/nginx/ ADD conf/php-fpm /etc/php/7.2/fpm/ COPY --chown=nginx:nginx app /srv/www +COPY --from=ochinchina/supervisord:latest /usr/local/bin/supervisord /usr/local/bin/supervisord +ADD conf/supervisord.conf /etc/supervisord.conf USER nginx diff --git a/README.md b/README.md index 8451a20..7cfb0a3 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,8 @@ Kill features: * Used the env variables for configure many parameters at start. * Fully compatible with PaaS-solutions like as Heroku, Flynn, Deis Workflow, Dokku and many others. * Internal port of nginx is taken from `$PORT` env variable. +* Used Supervisord written on Golang. +* Small image size (for Debian-based of course). **Every week travis auto build the docker image and push to the registry.** diff --git a/conf/nginx/nginx.conf.tmpl b/conf/nginx/nginx.conf.tmpl index ebfa48c..8cc666b 100644 --- a/conf/nginx/nginx.conf.tmpl +++ b/conf/nginx/nginx.conf.tmpl @@ -32,7 +32,6 @@ http { client_header_buffer_size 5K; client_body_timeout $NGINX_BODY_TIMEOUT; client_header_timeout $NGINX_HEADER_TIMEOUT; - keepalive_timeout 30; include /etc/nginx/host.conf; } \ No newline at end of file diff --git a/conf/start.sh b/conf/start.sh index 90f43a8..4a448c3 100755 --- a/conf/start.sh +++ b/conf/start.sh @@ -30,4 +30,4 @@ varrick -x /etc/php/7.2/fpm/pool.d/www.conf.tmpl /etc/php/7.2/fpm/pool.d varrick -x /etc/php/7.2/fpm/php.ini.tmpl /etc/php/7.2/fpm # Start supervisord and services -/usr/local/bin/supervisord -n -c /etc/supervisord.conf +/usr/local/bin/supervisord -c /etc/supervisord.conf