@@ -8,73 +8,16 @@ LABEL org.opencontainers.image.source="https://github.com/netflix/dispatch"
8
8
LABEL org.opencontainers.image.vendor="Netflix, Inc."
9
9
LABEL org.opencontainers.image.authors=
"[email protected] "
10
10
11
+ # Get and set up Node for front-end asset building
11
12
RUN apt-get update && apt-get install -y --no-install-recommends \
12
- # Needed for GPG
13
- dirmngr \
14
- gnupg2 \
15
13
# Needed for fetching stuff
16
14
ca-certificates \
17
15
wget \
18
16
&& rm -rf /var/lib/apt/lists/*
19
17
20
- # Fetch trusted keys
21
- RUN for key in \
22
- # gosu
23
- B42F6819007F00F88E364FD4036A9C25BF357DD4 \
24
- # tini
25
- 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7 \
26
- # Node - gpg keys listed at https://github.com/nodejs/node
27
- 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \
28
- FD3A5288F042B6850C66B31F09FE44734EB7990E \
29
- 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \
30
- DD8F2338BAE7501E3DD5AC78C273792F7D83545D \
31
- C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \
32
- B9AE9905FFD7803F25714661B63B535A4C206CA9 \
33
- 77984A986EBC2AA786BC0F66B01FBB92821C587A \
34
- 8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \
35
- 4ED778F539E3634C779C87C6D7062848A1AB005C \
36
- A48C2BEE680E841632CD4E44F07496B3EB3C1762 \
37
- B9E2F5981AA6E0CD28160D9FF13993A75599653C \
38
- ; do \
39
- # Let's try several servers to ensure we get all the keys
40
- for server in \
41
- keys.openpgp.org \
42
- keyserver.ubuntu.com \
43
- hkps.pool.sks-keyservers.net \
44
- ; do \
45
- gpg2 --batch --keyserver "$server" --recv-keys "$key" ; \
46
- done \
47
- done
48
-
49
- # grab gosu for easy step-down from root
50
- ENV GOSU_VERSION 1.12
51
- RUN set -x \
52
- && dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
53
- && wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" \
54
- && wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc" \
55
- && gpg2 --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
56
- && rm -f /usr/local/bin/gosu.asc \
57
- && chmod +x /usr/local/bin/gosu
58
-
59
- # grab tini for signal processing and zombie killing
60
- ENV TINI_VERSION 0.18.0
61
18
RUN set -x \
62
- && wget -O /usr/local/bin/tini "https://github.com/krallin/tini/releases/download/v$TINI_VERSION/tini" \
63
- && wget -O /usr/local/bin/tini.asc "https://github.com/krallin/tini/releases/download/v$TINI_VERSION/tini.asc" \
64
- && gpg --batch --verify /usr/local/bin/tini.asc /usr/local/bin/tini \
65
- && rm -f /usr/local/bin/tini.asc \
66
- && chmod +x /usr/local/bin/tini
67
-
68
- # Get and set up Node for front-end asset building
69
- COPY .nvmrc /usr/src/dispatch/
70
- RUN cd /usr/src/dispatch \
71
- && export NODE_VERSION="$(cat .nvmrc)" \
72
- && wget "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz" \
73
- && wget "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
74
- && gpg --batch --verify SHASUMS256.txt.asc \
75
- && grep " node-v$NODE_VERSION-linux-x64.tar.gz\$ " SHASUMS256.txt.asc | sha256sum -c - \
76
- && tar -xzf "node-v$NODE_VERSION-linux-x64.tar.gz" -C /usr/local --strip-components=1 \
77
- && rm -f "node-v$NODE_VERSION-linux-x64.tar.gz" SHASUMS256.txt.asc
19
+ && wget --quiet -O - https://deb.nodesource.com/setup_12.x | bash - \
20
+ && apt-get install -y nodejs
78
21
79
22
ARG SOURCE_COMMIT
80
23
ENV DISPATCH_BUILD=${SOURCE_COMMIT:-unknown}
109
52
# add our user and group first to make sure their IDs get assigned consistently
110
53
RUN groupadd -r dispatch && useradd -r -m -g dispatch dispatch
111
54
112
- COPY --from=sdist /usr/local/bin/gosu /usr/local/bin/tini /usr/local/bin/node /usr/local/bin/
113
-
114
55
# Sane defaults for pip
115
56
ENV PIP_NO_CACHE_DIR=off \
116
57
PIP_DISABLE_PIP_VERSION_CHECK=1 \
@@ -121,6 +62,9 @@ RUN set -x \
121
62
&& echo "deb http://apt.postgresql.org/pub/repos/apt buster-pgdg main" > /etc/apt/sources.list.d/pgdg.list \
122
63
&& wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
123
64
65
+ RUN set -x \
66
+ && wget --quiet -O - https://deb.nodesource.com/setup_12.x | bash -
67
+
124
68
COPY --from=sdist /dist/*.whl /tmp/dist/
125
69
RUN set -x \
126
70
&& buildDeps="" \
@@ -134,9 +78,10 @@ RUN set -x \
134
78
# These are also installed last as they are needed
135
79
# during container run and can have the same deps w/
136
80
&& apt-get install -y --no-install-recommends \
137
- pkg-config postgresql-client-12 \
81
+ pkg-config postgresql-client-12 nodejs \
138
82
&& apt-get clean \
139
- && rm -rf /var/lib/apt/lists/*
83
+ && rm -rf /var/lib/apt/lists/* \
84
+ && npm install mjml
140
85
141
86
EXPOSE 8000
142
87
VOLUME /var/lib/dispatch/files
0 commit comments