forked from skorpworks/logbus
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.bionic
46 lines (36 loc) · 1.24 KB
/
Dockerfile.bionic
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
FROM ubuntu:18.04
WORKDIR /opt/logbus
# systemd pkg needed for journal input plugin
RUN \
apt-get update \
&& apt-get install -y nodejs npm curl systemd strace \
&& rm -rf /var/lib/apt/lists/*
RUN \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add \
&& echo 'deb https://dl.yarnpkg.com/debian/ stable main' > /etc/apt/sources.list.d/yarn.list \
&& apt-get update \
&& apt-get install -y yarn \
&& rm -rf /var/lib/apt/lists/*
ENV NODE_ENV production
ADD package.json .
RUN yarn --ignore-engines --ignore-optional && yarn cache clean
ADD lib lib
ADD stage.js .
ADD index.js .
ARG KAFKA
RUN if test -n "${KAFKA}"; then \
apt-get update \
&& apt-get install -y build-essential python-dev \
&& rm -rf /var/lib/apt/lists/* \
&& yarn add --no-lockfile node-rdkafka@${KAFKA}; \
fi
ARG ALASQL
RUN if test -n "${ALASQL}"; then yarn add --no-lockfile alasql@${ALASQL}; fi
ARG MAXMIND
RUN if test -n "${MAXMIND}"; then yarn add --no-lockfile maxmind-db-reader@${MAXMIND}; fi
# The `bin` in package.json doesn't work since node_modules in .dockerignore
#
# npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/local/lib/node_modules/logbus/index.js'
#
RUN ln -s /opt/logbus/index.js /usr/bin/logbus
ENTRYPOINT ["logbus"]