FROM eclipse-temurin:17-jre-jammy

WORKDIR /opt/shukria-mw

COPY jpos/build/install/jpos/ .

# Override cfg and deploy with source distribution files
COPY jpos/src/dist/cfg/ cfg/
COPY jpos/src/dist/deploy/ deploy/

# Convert Windows CRLF line endings to Unix LF
RUN sed -i 's/\r$//' bin/q2 bin/start bin/stop && \
    chmod +x bin/q2 bin/start bin/stop

# jPOS ports
# 9100 — NCC plain channel   (11_bshserver.xml)
# 9104 — NAC SSL channel     (12_bshserver_nac.xml)
# 9103 — NAC non-SSL channel (13_non_ssl.xml)
EXPOSE 9100 9103 9104

CMD ["bin/q2"]
