From 949d4151263cc77f8906ec1772a725093d826a9e Mon Sep 17 00:00:00 2001 From: Vivek Kumar Dutta <vivek.dutta@iopsys.eu> Date: Tue, 5 Sep 2023 19:19:43 +0530 Subject: [PATCH] Example oci container for ACS --- examples/acs/Dockerfile | 53 +++++++++++++++++++++++++++++++++++ examples/acs/acs.conf | 14 +++++++++ examples/acs/supervisord.conf | 19 +++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 examples/acs/Dockerfile create mode 100644 examples/acs/acs.conf create mode 100644 examples/acs/supervisord.conf diff --git a/examples/acs/Dockerfile b/examples/acs/Dockerfile new file mode 100644 index 0000000..86225f7 --- /dev/null +++ b/examples/acs/Dockerfile @@ -0,0 +1,53 @@ +FROM ubuntu:20.04 + +LABEL maintainer="vivek.dutta@iopsys.eu" +LABEL build="docker build -t acs ." + +# docker build -t acs . +# docker images + + +RUN \ + apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y \ + # General tools + apt-utils \ + apt-transport-https \ + git \ + libssl-dev \ + build-essential \ + curl \ + iputils-ping \ + net-tools \ + pkg-config \ + sudo \ + supervisor \ + wget \ + mongodb + +# install node +ARG NODEJS_VERSION_MAJOR=16 +RUN curl -fsSL "https://deb.nodesource.com/setup_${NODEJS_VERSION_MAJOR}.x" | bash - && \ + apt-get install -y nodejs && \ + npm install --global typescript yarn && \ + rm -rf /var/lib/apt/lists/* + +# install yarn +RUN npm install --global "yarn" + +# install tap-junit +ARG GENIE_VERSION=1.2.9 +RUN npm install --global "genieacs@${GENIE_VERSION}" + +# Prepare supervisor +RUN mkdir -p /var/log/supervisor && \ + mkdir -p /etc/supervisor/conf.d/ && \ + mkdir -p /data/db +COPY supervisord.conf /etc/supervisor/ +COPY acs.conf /etc/supervisor/conf.d/ + +EXPOSE 3000 +EXPOSE 7547 + +# Start entrypoint +ENTRYPOINT ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf"] diff --git a/examples/acs/acs.conf b/examples/acs/acs.conf new file mode 100644 index 0000000..8e46d58 --- /dev/null +++ b/examples/acs/acs.conf @@ -0,0 +1,14 @@ +[program:mongod] +command=/bin/bash -c "/usr/bin/mongod" + +[program:genieacs_cwmp] +command=/bin/bash -c "/usr/bin/genieacs-cwmp" + +[program:genieacs_fs] +command=/bin/bash -c "/usr/bin/genieacs-fs" + +[program:genieacs_nbi] +command=/bin/bash -c "/usr/bin/genieacs-nbi" + +[program:genieacs_ui] +command=/bin/bash -c "/usr/bin/genieacs-ui --ui-jwt-secret secret" diff --git a/examples/acs/supervisord.conf b/examples/acs/supervisord.conf new file mode 100644 index 0000000..aeb9849 --- /dev/null +++ b/examples/acs/supervisord.conf @@ -0,0 +1,19 @@ +[supervisord] +logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log) +pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid) +childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP) +nodaemon=false ; true to run in foreground + +[unix_http_server] +file=/var/run/supervisor.sock ; (the path to the socket file) +chmod=0700 ; sockef file mode (default 0700) + +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + +[supervisorctl] +serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket + +; enables us to add additional applications in a convenient way +[include] +files = /etc/supervisor/conf.d/*.conf -- GitLab