-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
61 lines (56 loc) · 2.48 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
49
50
51
52
53
54
55
56
57
58
59
60
61
FROM alpine:3.12 as builder
RUN set -eux \
&& apk add --no-cache \
nodejs-current \
npm
ARG VERSION=7.9.0
RUN set -eux \
&& npm install --production --remove-dev eslint@$VERSION \
@tivix/eslint-config \
@tivix/prettier-config \
@tivix/typescript-config \
@tivix/stylelint-config \
prettier@2.0.5 \
eslint-plugin-prettier@3.1.4 \
typescript@4.0.3 \
@typescript-eslint/eslint-plugin@4.2.0 \
@typescript-eslint/parser@4.2.0 \
&& /node_modules/eslint/bin/eslint.js --version | grep -E '^v?[0-9]+'
# Remove unecessary files
RUN set -eux \
&& find /node_modules -type d -iname 'test' -prune -exec rm -rf '{}' \; \
&& find /node_modules -type d -iname 'tests' -prune -exec rm -rf '{}' \; \
&& find /node_modules -type d -iname 'testing' -prune -exec rm -rf '{}' \; \
&& find /node_modules -type d -iname '.bin' -prune -exec rm -rf '{}' \; \
\
&& find /node_modules -type f -iname '.*' -exec rm {} \; \
&& find /node_modules -type f -iname 'LICENSE*' -exec rm {} \; \
&& find /node_modules -type f -iname 'Makefile*' -exec rm {} \; \
&& find /node_modules -type f -iname '*.bnf' -exec rm {} \; \
&& find /node_modules -type f -iname '*.css' -exec rm {} \; \
&& find /node_modules -type f -iname '*.def' -exec rm {} \; \
&& find /node_modules -type f -iname '*.flow' -exec rm {} \; \
&& find /node_modules -type f -iname '*.html' -exec rm {} \; \
&& find /node_modules -type f -iname '*.info' -exec rm {} \; \
&& find /node_modules -type f -iname '*.jst' -exec rm {} \; \
&& find /node_modules -type f -iname '*.lock' -exec rm {} \; \
&& find /node_modules -type f -iname '*.map' -exec rm {} \; \
&& find /node_modules -type f -iname '*.markdown' -exec rm {} \; \
&& find /node_modules -type f -iname '*.md' -exec rm {} \; \
&& find /node_modules -type f -iname '*.mjs' -exec rm {} \; \
&& find /node_modules -type f -iname '*.mli' -exec rm {} \; \
&& find /node_modules -type f -iname '*.png' -exec rm {} \; \
&& find /node_modules -type f -iname '*.yml' -exec rm {} \;
FROM alpine:3.12
LABEL \
maintainer="Tivix <michal.kopacki@tivix.com>" \
repo="https://github.com/tivix/docker-jslinter"
COPY docker-entrypoint.sh /
COPY --from=builder /node_modules/ /node_modules/
RUN set -eux \
&& apk add --no-cache nodejs-current \
&& ln -sf /node_modules/eslint/bin/eslint.js /usr/bin/eslint \
&& ln -sf /node_modules/prettier/bin-prettier.js /usr/bin/prettier \
&& ln -sf /node_modules/typescript/bin/tsc /usr/bin/tsc
WORKDIR /code
ENTRYPOINT ["/docker-entrypoint.sh"]