forked from rtfpessoa/codacy-remark-lint
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDockerfile
48 lines (30 loc) · 1.02 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
41
42
43
44
45
46
47
48
ARG NODE_IMAGE_VERSION=20-alpine
FROM node:$NODE_IMAGE_VERSION as build
LABEL maintainer="Codacy <[email protected]>"
ENV NODE_PATH /usr/lib/node_modules
WORKDIR /workdir
COPY package.json .
COPY yarn.lock .
RUN yarn
COPY . .
RUN yarn run build
FROM node:$NODE_IMAGE_VERSION
LABEL maintainer="Codacy <[email protected]>"
ENV NODE_PATH /app/node_modules
ENV PATH /app/node_modules/.bin:$PATH
RUN adduser -u 2004 -D docker
COPY --from=build --chown=docker:docker /workdir/build/main /app/build/main
COPY --from=build --chown=docker:docker /workdir/package.json /app/package.json
COPY --from=build --chown=docker:docker /workdir/yarn.lock /app/yarn.lock
COPY --from=build --chown=docker:docker /workdir/docs /docs
COPY --from=build --chown=docker:docker /workdir/docs-tests /docs/tests
WORKDIR /app
RUN \
yarn install --production --cache-folder /tmp/yarn-cache && \
yarn link && \
chmod +x /app/build/main/index.js && \
rm -rf /tmp/yarn-cache /root/.yarn
WORKDIR /src
USER docker
ENTRYPOINT ["codacy-remark-lint"]
CMD []