From 82fbaed6d986a8bfaee90fa8504475033278cc47 Mon Sep 17 00:00:00 2001 From: HazCod Date: Tue, 31 May 2016 09:54:12 +0200 Subject: [PATCH 1/2] Add gosu --- Dockerfile | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3a9b0c5..48d157f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,31 @@ # docker-logentries # # VERSION 0.2.0 - -FROM node:0.12-onbuild +FROM node MAINTAINER Matteo Collina +# GoSu work +ENV GOSU_VERSION 1.9 +RUN apt-get update \ + && apt-get install -y \ + curl \ + && gpg --keyserver pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \ + && curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \ + && curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \ + && gpg --verify /usr/local/bin/gosu.asc \ + && rm /usr/local/bin/gosu.asc \ + && chmod +x /usr/local/bin/gosu \ + && apt-get clean \ + && apt-get autoremove -y \ + curl \ + && rm -rf /var/lib/apt/lists/* + WORKDIR /usr/src/app COPY package.json package.json RUN npm install --production COPY index.js /usr/src/app/index.js -ENTRYPOINT ["/usr/src/app/index.js"] -CMD [] +ADD run.sh /usr/src/run.sh +RUN chmod +x /usr/src/run.sh + +ENTRYPOINT /usr/src/run.sh From 2d014ca4ae80f90e3eff9c73194ad39b38b5d40c Mon Sep 17 00:00:00 2001 From: HazCod Date: Tue, 31 May 2016 09:54:49 +0200 Subject: [PATCH 2/2] Add run.sh --- run.sh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 run.sh diff --git a/run.sh b/run.sh new file mode 100644 index 0000000..b3f95f7 --- /dev/null +++ b/run.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +useradd node +chown -R node:node /usr/src + +gosu node:${GID} /usr/src/app/index.js --secure -i 60 -l "$logs" -k "$stats" -e "$events"