- Modifié
Bonsoir
Me revoila à la charge avec une nouvelle image Docker (qui compile et qui fonctionne )
J'ai donc créer une image docker contenant Nginx sous Alpine, mon but étant de créer un reverse proxy avec une image dédié à ça, car sur le docker hub on trouve des images nginx, mais pas dédié au reverse ou a la génération de page, elles font les deux. Le but étant d'essayer d'améliorer ma vitesse de chargement (même 0.05 secondes c'est toujours bien). En certificat SSL je vais commencer à migrer vers des certificats en ECDSA.
Donc j'aimerai séparer les deux, c'est pour ça que j'ai créer mon image Nginx
J'ai donc plusieurs questions ^^ :
- L'image est-elle bien / complète ?
- Est-ce mieux de mieux de mettre la compression avant d'envoyer au reverse proxy ou que ce soit le reverse proxy qui compresse ?
- Avez vous des conseils à me donner ? (autre que le fait d'avoir 2 RUN, c'est pour éviter d'avoir à retélécharger les 60 paquets, ça fait lourd sur ma petite connexion
Voici mon Dockerfile
FROM alpine:3.5
MAINTAINER Dryusdan <contact@dryusdan.fr>
ENV UID=991 GID=991
ARG NGINX_VER=1.11.8
ARG NGINX_GPG="B0F4253373F8F6F510D42178520A9993A1C052F8"
ARG BUILD_CORES
ARG NGINX_CONF="--prefix=/nginx \
--sbin-path=/usr/local/sbin/nginx \
--http-log-path=/nginx/log/nginx_access.log \
--error-log-path=/nginx/log/nginx_error.log \
--pid-path=/nginx/run/nginx.pid \
--lock-path=/nginx/run/nginx.lock \
--user=web --group=web \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_sub_module \
--with-http_gzip_static_module \
--with-http_random_index_module \
--with-http_secure_link_module \
--with-http_stub_status_module \
--with-threads \
--with-stream \
--with-stream_ssl_module \
--with-http_slice_module \
--with-mail \
--with-mail_ssl_module \
--with-http_v2_module \
--with-ipv6 \
--without-http_ssi_module \
--without-http_scgi_module \
--without-http_uwsgi_module \
--without-http_geo_module \
--without-http_autoindex_module \
--without-http_map_module \
--without-http_split_clients_module \
--without-http_memcached_module \
--without-http_empty_gif_module \
--without-http_browser_module \
--without-http_rewrite_module \
--without-http_fastcgi_module \
--add-module=/tmp/headers-more-nginx-module \
--add-module=/tmp/ngx_brotli "
RUN BUILD_DEPS=" \
build-base \
linux-headers \
ca-certificates \
automake \
autoconf \
git \
tar \
libtool \
pcre-dev \
zlib-dev \
binutils \
gnupg \
cmake \
libressl-dev \
go" \
&& apk -U add \
${BUILD_DEPS} \
s6 \
su-exec \
openssl \
pcre \
zlib \
&& NB_CORES=${BUILD_CORES-$(grep -c "processor" /proc/cpuinfo)}
RUN \
cd /tmp && git clone https://github.com/bagder/libbrotli --depth=1 && cd libbrotli \
&& ./autogen.sh && ./configure && make -j ${BUILD_CORES} && make install \
&& cd /tmp \
&& git clone https://github.com/google/ngx_brotli \
&& git clone https://github.com/openresty/headers-more-nginx-module \
&& cp -R /tmp/libbrotli/brotli /tmp/ngx_brotli/deps && echo "*** LS ***" && ls /tmp/ngx_brotli/deps/brotli \
&& wget http://nginx.org/download/nginx-${NGINX_VER}.tar.gz \
&& wget http://nginx.org/download/nginx-${NGINX_VER}.tar.gz.asc \
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$NGINX_GPG" \
&& gpg --batch --verify nginx-${NGINX_VER}.tar.gz.asc nginx-${NGINX_VER}.tar.gz \
&& tar xzf nginx-${NGINX_VER}.tar.gz \
&& cd /tmp/nginx-${NGINX_VER} \
&& ./configure ${NGINX_CONF} \
&& make -j ${BUILD_CORES} \
&& make install \
&& apk del ${BUILD_DEPS} \
&& rm -rf /tmp/* /var/cache/apk/*
#&& mkdir /sites-enabled /www /conf.d /passwds /certs /log
COPY rootfs /
RUN chmod +x /usr/local/bin/startup /etc/s6.d/*/*
EXPOSE 8080 8430
VOLUME /nginx
ENTRYPOINT ["/usr/local/bin/startup"]
CMD ["/bin/s6-svscan", "/etc/s6.d"]
Merci d'avance pour vos réponses (et bonne nuit ^^ )