-
Notifications
You must be signed in to change notification settings - Fork 93
/
Dockerfile
40 lines (29 loc) · 1.08 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
38
39
40
FROM node:17.3-bullseye-slim
LABEL maintainer "Code Climate <[email protected]>"
RUN adduser --uid 9000 --gecos "" --disabled-password app
WORKDIR /usr/src/app
ENV PREFIX=/usr/local/node_modules
ENV PATH=$PREFIX/.bin:$PATH
ENV NODE_PATH=$PREFIX
ENV NPM_CONFIG_PREFIX=$PREFIX
RUN mkdir $PREFIX
COPY bin/docs ./bin/docs
COPY engine.json package.json yarn.lock ./
RUN apt-get update && apt-get install -y gnupg
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 install -y git jq yarn && \
yarn config set prefix $PREFIX && \
yarn install --modules-folder $PREFIX && \
chown -R app:app $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
COPY . ./
RUN chown -R app:app ./
USER app
VOLUME /code
WORKDIR /code
CMD ["/usr/src/app/bin/eslint.js"]