1
0
mirror of https://github.com/yldio/copilot.git synced 2024-11-11 05:40:11 +02:00

Fixing yarn install and permissions

This commit is contained in:
Tom Gallacher 2016-10-20 15:23:12 +01:00
parent 4565e142cf
commit 0adce28a1c

View File

@ -7,15 +7,14 @@ RUN set -x \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& groupadd -g 433 -r nodejs \ && groupadd -g 433 -r nodejs \
&& useradd -u 431 -r -g nodejs -d /home/nodejs -s /sbin/nologin -c "Docker image user" nodejs \ && useradd -u 431 -r -g nodejs -d /home/nodejs -s /sbin/nologin -c "Docker image user" nodejs \
&& mkdir -p /home/nodejs/ \ && mkdir -p /home/nodejs/
&& chown -R nodejs:nodejs /home/nodejs/
# Get and configure containerpilot # Get and configure containerpilot
ENV CONTAINERPILOT_VERSION 2.4.1 ENV CONTAINERPILOT_VERSION 2.4.3
ENV CONTAINERPILOT file:///etc/containerpilot.json ENV CONTAINERPILOT file:///etc/containerpilot.json
RUN export CP_SHA1=198d96c8d7bfafb1ab6df96653c29701510b833c \ RUN export CP_SHA1=2c469a0e79a7ac801f1c032c2515dd0278134790 \
&& curl -Lso /tmp/containerpilot.tar.gz \ && curl -Lo /tmp/containerpilot.tar.gz \
"https://github.com/joyent/containerpilot/releases/download/${CONTAINERPILOT_VERSION}/containerpilot-${CONTAINERPILOT_VERSION}.tar.gz" \ "https://github.com/joyent/containerpilot/releases/download/${CONTAINERPILOT_VERSION}/containerpilot-${CONTAINERPILOT_VERSION}.tar.gz" \
&& echo "${CP_SHA1} /tmp/containerpilot.tar.gz" | sha1sum -c \ && echo "${CP_SHA1} /tmp/containerpilot.tar.gz" | sha1sum -c \
&& tar zxf /tmp/containerpilot.tar.gz -C /bin \ && tar zxf /tmp/containerpilot.tar.gz -C /bin \
@ -23,10 +22,11 @@ RUN export CP_SHA1=198d96c8d7bfafb1ab6df96653c29701510b833c \
COPY ./etc/containerpilot.json /etc/ COPY ./etc/containerpilot.json /etc/
USER nodejs
WORKDIR /home/nodejs/ WORKDIR /home/nodejs/
ADD package.json . COPY package.json yarn.lock ./
RUN npm install # yarn COPY . .
ADD . . RUN chown -R nodejs:nodejs /home/nodejs/
USER nodejs
RUN yarn || cat yarn-error.log
CMD [ "/bin/containerpilot", "node", "src/index.js" ] CMD [ "/bin/containerpilot", "node", "src/index.js" ]