added musvcs:oe_gateway

This commit is contained in:
2024-12-13 20:01:45 -05:00
parent 3190cf5d4d
commit b4f818ac1a
5 changed files with 94 additions and 28 deletions
+3
View File
@@ -0,0 +1,3 @@
.git
**/__pycache__
.pipenv
+25
View File
@@ -0,0 +1,25 @@
FROM python:3.12-slim
ARG ROOT_MCRSVC_DIR=docker_dev/microservices
ARG FROM_DIR=${ROOT_MCRSVC_DIR}/oe_gateway
COPY ${ROOT_MCRSVC_DIR}/requirements.txt /
RUN pip install --upgrade pip --root-user-action=ignore
RUN pip install -r /requirements.txt --root-user-action=ignore
COPY cvttpy /cvttpy
COPY ${ROOT_MCRSVC_DIR}/.creds /.creds
COPY ${FROM_DIR}/run_oegw.sh /run_oegw.sh
RUN chmod +x /run_oegw.sh
RUN mkdir /logs
RUN mkdir -p /config
WORKDIR /
SHELL ["/bin/bash", "-c"]
ENV PYTHONPATH=/
ENTRYPOINT [ "/run_oegw.sh" ]
+48
View File
@@ -0,0 +1,48 @@
#!/bin/bash
# runs in container
# runs on host to start container
usage() {
echo -n "Usage: ${0}"
echo -n " [-c <config (/config/cvtt.cfg)>]"
echo -n " [-a <admin_port (7220)>]"
echo -n " [-z (compress log)"]
echo
exit 1
}
Config=/config/cvtt.cfg
AdminPort=7220
COMPRESS_LOG=false
while getopts "c:a:z" opt; do
case ${opt} in
c ) Config=$OPTARG ;;
a ) AdminPort=$OPTARG ;;
z ) COMPRESS_LOG=true ;;
\? )
echo "Invalid option: -$OPTARG" >&2
usage
;;
: )
echo "Option -$OPTARG requires an argument." >&2
usage
;;
esac
done
Cmd="python3.12"
Cmd="${Cmd} cvttpy/apps/microservices/market_gateways/order_entry_gateway.py"
Cmd="${Cmd} --config=${Config}"
Cmd="${Cmd} --credentials_file=/.creds"
Cmd="${Cmd} --admin_port=${AdminPort}"
Cmd="${Cmd} --log_file=/logs/%T.md_gateway.log"
if ${COMPRESS_LOG} ; then
Cmd="${Cmd} --compress_log"
fi
echo ${Cmd}
eval ${Cmd}