FROM balabit/syslog-ng:latest
env DEBIAN_FRONTEND=noninteractive

####################
# COOMMON PART.
####################
# for systems with apt
RUN apt update && \
apt install -y python3-jinja2 python3-dotenv
# for systems without apt but with pip
# RUN sudo python -m pip install --upgrade pip && \
#     sudo pip install python-dotenv && sudo pip install Jinja2

# Python3 as default
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1

# Copy parser and environment to root
#COPY fill_templates.py /
# COPY .env /

########################
# CUSTOM PART
########################

# Put tpl-files where they will be parsed
COPY *.conf.tpl /etc/syslog-ng/
# Copy parser and environment to root
COPY fill_templates.py /


WORKDIR /
ENTRYPOINT ["python", "fill_templates.py"]                   # MUST be JSON-array syntax

# Place here original ENTRYPOINT and update it when in mother Dockerfile it will be updated\changed
CMD /usr/sbin/syslog-ng -F