This repository has been archived by the owner on Oct 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
56 lines (56 loc) · 1.82 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
FROM node:12-alpine3.11
RUN set -ex; \
\
apk add --no-cache \
bash \
tini \
; \
\
npm install -g coffeescript@^2.4.1; \
\
addgroup -g 101 -S taiga; \
adduser -D -H -g taiga -G taiga -s /sbin/nologin -S -u 101 taiga; \
\
mkdir /etc/opt/taiga-events; \
touch /var/log/taiga-events.log; \
chown taiga:taiga /var/log/taiga-events.log; \
\
rm -rf /root/.config /root/.npm /var/cache/apk/*
ENV TAIGA_EVENTS_VERSION=2de073c1a3883023050597a47582c6a7405914de \
TAIGA_EVENTS_SHA256SUM=447447e0deb289f6c03c1227d65d66e19ffe55569bf02151dc08a5f5513df2bd
RUN set -exo pipefail; \
\
apk add --no-cache --virtual .build-deps \
jq \
moreutils \
; \
\
wget -q -O taiga-events.tar.gz \
https://github.com/taigaio/taiga-events/archive/${TAIGA_EVENTS_VERSION}.tar.gz; \
echo "${TAIGA_EVENTS_SHA256SUM} taiga-events.tar.gz" | sha256sum -c; \
tar -xzf taiga-events.tar.gz; \
rm taiga-events.tar.gz; \
mv taiga-events-${TAIGA_EVENTS_VERSION} /opt/taiga-events; \
\
cd /opt/taiga-events; \
find . -type d -exec chmod 755 '{}' +; \
find . -type f -exec chmod 644 '{}' +; \
cat package.json | \
# Make sure development dependencies are not installed
jq 'del(.devDependencies)' | \
# Fix security vulnerabilities
jq '.dependencies["base64-url"] = "^2.3.2" | .dependencies.ws = "^7.1.1"' | \
sponge package.json; \
npm install; \
sed -i 's/8888/8080/' config.example.json; \
mv config.example.json /etc/opt/taiga-events/config.json; \
ln -s /etc/opt/taiga-events/config.json config.json; \
cd -; \
\
apk del .build-deps; \
rm -rf /root/.config /root/.npm /var/cache/apk/*
COPY root /
WORKDIR /opt/taiga-events
USER taiga
ENTRYPOINT ["taiga-events"]
EXPOSE 8080