forked from codeclimate/codeclimate-eslint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
37 lines (29 loc) · 1.05 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
FROM node:6.10.0-slim
LABEL maintainer "Code Climate <[email protected]>"
RUN apt-key adv --fetch-keys http://dl.yarnpkg.com/debian/pubkey.gpg && \
echo "deb http://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update
WORKDIR /usr/src/app
COPY bin/docs ./bin/docs
COPY engine.json package.json yarn.lock ./
RUN mkdir /usr/local/node_modules
ENV PREFIX=/usr/local/node_modules
ENV PATH=$PREFIX/.bin:$PATH
ENV NODE_PATH=$PREFIX
ENV NPM_CONFIG_PREFIX=$PREFIX
RUN apt-get install -y git jq yarn && \
yarn config set prefix $PREFIX && \
yarn install --modules-folder $PREFIX && \
version="v$(yarn list eslint | grep eslint | sed -n 's/.*@//p')" && \
bin/docs "$version" && \
cat engine.json | jq ".version = \"$version\"" > /engine.json && \
apt-get purge -y git jq yarn && \
apt-get autoremove --yes
RUN adduser --uid 9000 --gecos "" --disabled-password app
COPY . ./
RUN chown -R app:app ./
RUN chown -R app:app $PREFIX
USER app
VOLUME /code
WORKDIR /code
CMD ["/usr/src/app/bin/eslint.js"]