36 lines
1.5 KiB
Docker
36 lines
1.5 KiB
Docker
FROM ubuntu:24.04
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
ENV APP_DIR=/opt/containers/nats-registration-listener
|
|
ENV DATA_DIR=${APP_DIR}/data
|
|
|
|
# Minimal deps + Python + dos2unix for CRLF→LF
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
bash curl jq ca-certificates tini python3 python3-pip dos2unix \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Python deps
|
|
RUN pip3 install --no-cache-dir --upgrade nats-py
|
|
|
|
# App payload (immutable inside image)
|
|
RUN mkdir -p ${APP_DIR}/app/bin
|
|
COPY files/nats-registration-listener.sh ${APP_DIR}/app/bin/nats-registration-listener.sh
|
|
COPY files/entrypoint.sh /usr/local/bin/nats-registration-entrypoint
|
|
COPY files/healthcheck.sh /usr/local/bin/nats-registration-healthcheck
|
|
COPY files/nats_registration_listener.py /usr/local/bin/nats_registration_listener.py
|
|
|
|
# Normalize line endings (in case files came from Windows) and set exec bits
|
|
RUN dos2unix /usr/local/bin/nats-registration-entrypoint \
|
|
/usr/local/bin/nats-registration-healthcheck \
|
|
${APP_DIR}/app/bin/nats-registration-listener.sh \
|
|
/usr/local/bin/nats_registration_listener.py \
|
|
&& chmod +x /usr/local/bin/nats-registration-entrypoint \
|
|
/usr/local/bin/nats-registration-healthcheck \
|
|
${APP_DIR}/app/bin/nats-registration-listener.sh
|
|
|
|
WORKDIR ${APP_DIR}/app
|
|
|
|
# Use tini as PID1; entrypoint validates env and execs the main script
|
|
ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/nats-registration-entrypoint"]
|
|
CMD ["/opt/containers/nats-registration-listener/app/bin/nats-registration-listener.sh"]
|