Skip to content
This repository has been archived by the owner on Aug 12, 2019. It is now read-only.

Commit

Permalink
add netflow service
Browse files Browse the repository at this point in the history
  • Loading branch information
oznu committed Oct 15, 2018
1 parent bb5344b commit 10bcce6
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Multi-stage build - See https://docs.docker.com/engine/userguide/eng-image/multistage-build
FROM ubnt/unms:0.13.0 as unms
FROM ubnt/unms-netflow:0.13.0 as unms-netflow
FROM oznu/s6-node:8.12.0-amd64

# base deps redis, rabbitmq
Expand Down Expand Up @@ -40,6 +41,19 @@ COPY --from=unms /usr/local/bin/docker-entrypoint.sh /usr/local/bin/docker-entry
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# end ubnt/unms dockerfile #

# start unms-netflow dockerfile #
RUN mkdir -p /home/app/netflow

COPY --from=unms-netflow /home/app /home/app/netflow

RUN devDeps="vips-dev fftw-dev make python g++" \
&& apk add --no-cache ${devDeps} \
&& cd /home/app/netflow \
&& JOBS=$(nproc) npm install \
&& apk del ${devDeps}

# end unms-netflow dockerfile #

# ubnt/nginx docker file #
ENV NGINX_UID=1000 \
NGINX_VERSION=nginx-1.12.2 \
Expand Down Expand Up @@ -116,6 +130,7 @@ ENV PATH=/home/app/unms/node_modules/.bin:$PATH \
WS_PORT=443 \
PUBLIC_HTTPS_PORT=443 \
PUBLIC_WS_PORT=443 \
UNMS_NETFLOW_PORT=2055 \
SECURE_LINK_SECRET=enigma \
SSL_CERT=""

Expand Down
15 changes: 15 additions & 0 deletions Dockerfile.raspberry-pi
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Multi-stage build - See https://docs.docker.com/engine/userguide/eng-image/multistage-build
FROM ubnt/unms:0.13.0 as unms
FROM ubnt/unms-netflow:0.13.0 as unms-netflow
FROM oznu/s6-node:8.12.0-armhf

# base deps redis, rabbitmq
Expand Down Expand Up @@ -40,6 +41,19 @@ COPY --from=unms /usr/local/bin/docker-entrypoint.sh /usr/local/bin/docker-entry
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# end ubnt/unms dockerfile #

# start unms-netflow dockerfile #
RUN mkdir -p /home/app/netflow

COPY --from=unms-netflow /home/app /home/app/netflow

RUN devDeps="vips-dev fftw-dev make python g++" \
&& apk add --no-cache ${devDeps} \
&& cd /home/app/netflow \
&& JOBS=$(nproc) npm install \
&& apk del ${devDeps}

# end unms-netflow dockerfile #

# ubnt/nginx docker file #
ENV NGINX_UID=1000 \
NGINX_VERSION=nginx-1.12.2 \
Expand Down Expand Up @@ -116,6 +130,7 @@ ENV PATH=/home/app/unms/node_modules/.bin:$PATH \
WS_PORT=443 \
PUBLIC_HTTPS_PORT=443 \
PUBLIC_WS_PORT=443 \
UNMS_NETFLOW_PORT=2055 \
SECURE_LINK_SECRET=enigma \
SSL_CERT=""

Expand Down
21 changes: 21 additions & 0 deletions root/etc/services.d/netflow/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/with-contenv sh

export HOME=/home/app
export HTTP_PORT=8081
export WS_PORT=8082
export WS_SHELL_PORT=8083
export UNMS_RABBITMQ_HOST=localhost
export UNMS_RABBITMQ_PORT=5672
export UNMS_REDISDB_HOST=localhost
export UNMS_REDISDB_PORT=6379
export UNMS_PG_HOST=localhost
export UNMS_PG_PORT=5432
export UNMS_FLUENTD_HOST=localhost
export UNMS_FLUENTD_PORT=8081
export UNMS_NGINX_HOST=localhost
export UNMS_NGINX_PORT=12345
export NODE_ENV=production

echo "Starting unms-netflow..."

s6-setuidgid root node /home/app/netflow/index.js

0 comments on commit 10bcce6

Please sign in to comment.