Dockerfiles optimized

This commit is contained in:
Juan Ferrer 2019-01-08 20:09:55 +01:00
parent 33b1f8b5f2
commit 9f181b15f8
2 changed files with 7 additions and 8 deletions

View File

@ -1,19 +1,20 @@
FROM debian:stretch-slim FROM debian:stretch-slim
ARG DEBIAN_FRONTEND=noninteractive ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update \ RUN apt-get update \
&& apt-get install -y --no-install-recommends apt-utils \
&& apt-get install -y --no-install-recommends \ && apt-get install -y --no-install-recommends \
curl \ curl \
ca-certificates \
gnupg2 \ gnupg2 \
&& curl -sL https://deb.nodesource.com/setup_8.x | bash - \ && curl -sL https://deb.nodesource.com/setup_8.x | bash - \
&& apt-get install -y \ && apt-get install -y --no-install-recommends \
nodejs \ nodejs \
&& apt-get purge -y --auto-remove \
curl \
gnupg2 \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& npm -g install pm2 && npm -g install pm2
WORKDIR /salix WORKDIR /salix
COPY package.json package-lock.json ./ COPY package.json package-lock.json ./
COPY loopback/package.json loopback/ COPY loopback/package.json loopback/

View File

@ -2,12 +2,10 @@ FROM debian:stretch-slim
EXPOSE 80 EXPOSE 80
ARG DEBIAN_FRONTEND=noninteractive ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update \ RUN apt-get update \
&& apt-get install -y --no-install-recommends nginx \ && apt-get install -y --no-install-recommends nginx \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/* \
&& ln -sf /dev/stdout /var/log/nginx/access.log \
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log && ln -sf /dev/stderr /var/log/nginx/error.log
WORKDIR /etc/nginx WORKDIR /etc/nginx