# -------------------------------------------------------------------------#
#  Copyright (c) 2022-2025 by Ciena Corporation, All Rights Reserved       #
#                                                                          #
#     _______ _____ __    __ ___                                           #
#    / _ __(_) ___//  |  / // _ |                                          #
#   / /   / / /__ / /|| / // / ||                                          #
#  / /___/ / /__ / / ||/ // /__||                                          #
# /_____/_/_____/_/  |__//_/   ||                                          #
#                                                                          #
# -------------------------------------------------------------------------#
FROM ubuntu:20.04

#
# Build commands
#

# Run the debian package manager in non-interactive mode
ARG DEBIAN_FRONTEND=noninteractive

# Prepare the base image
RUN apt-get update -y 
RUN apt-get upgrade -y

# Install debug utilities
RUN apt-get install apt-utils -y
RUN apt-get install net-tools -y
RUN apt-get install iputils-ping -y
RUN apt-get install iproute2 -y

# Install the PON Controller binary package
RUN mkdir -p /tmp
WORKDIR /tmp
COPY tibit-poncntl_R5.2.0_amd64.deb /tmp
RUN cd /tmp && apt-get install ./tibit-poncntl_R5.2.0_amd64.deb -y

#
# Runtime commands
#

# PON Controller only, no UMT Relay and no Authenticator
# Run the binary PON Controller
CMD /opt/tibit/poncntl/bin/tibit-poncntl -c /etc/tibit/poncntl/PonCntlInit.json

# PON Controller with UMT Relay and the Authenticator
#
# To enable all three services:
#   1) Comment out the 'PON Controller only' section above
#   2) Uncomment the following to start the PON Controller, UMT Relay,
#      and the Authenticator via supervisord.
#RUN apt-get install -y supervisor
#COPY docker/supervisord.conf /etc/supervisor/supervisord.conf
#CMD /usr/bin/supervisord -c /etc/supervisor/supervisord.conf

#CMD bash
