added musvcs:oe_gateway
This commit is contained in:
parent
3190cf5d4d
commit
b4f818ac1a
@ -2,48 +2,38 @@ version: "3.9"
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
md_gateway:
|
md_gateway:
|
||||||
image: md_gateway:latest
|
image: cloud21.cvtt.vpn:5500/md_gateway:latest
|
||||||
container_name: md_gateway
|
container_name: md_gateway
|
||||||
environment:
|
environment:
|
||||||
- REDIS_HOST=redis
|
- REDIS_HOST=redis
|
||||||
volumes:
|
volumes:
|
||||||
- ./config:/shared/config
|
- ./config:/config
|
||||||
- ./logs:/shared/logs
|
- ./logs:/logs
|
||||||
- ./data:/data
|
- ./data:/data
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- redis
|
||||||
|
|
||||||
|
tester:
|
||||||
|
image: cloud21.cvtt.vpn:5500/tester:latest
|
||||||
|
container_name: tester
|
||||||
|
environment:
|
||||||
|
- REDIS_HOST=redis
|
||||||
|
volumes:
|
||||||
|
- ./config:/config
|
||||||
|
- ./logs:/logs
|
||||||
|
- ./data:/data
|
||||||
|
depends_on:
|
||||||
|
- redis
|
||||||
|
- md_gateway
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:latest
|
image: redis:latest
|
||||||
container_name: redis
|
container_name: redis
|
||||||
ports:
|
ports:
|
||||||
- "6379:6379"
|
- "6379:6379"
|
||||||
volumes:
|
volumes:
|
||||||
- redis_data:/data/redis
|
- ./data/redis:/data
|
||||||
|
|
||||||
volumes:
|
|
||||||
redis_data:
|
|
||||||
# version: "3.9"
|
|
||||||
|
|
||||||
# services:
|
|
||||||
# redis:
|
|
||||||
# image: redis:latest
|
|
||||||
# container_name: redis
|
|
||||||
# ports:
|
|
||||||
# - "6379:6379"
|
|
||||||
# volumes:
|
|
||||||
# - redis_data:/data
|
|
||||||
|
|
||||||
# market_data_gateway:
|
|
||||||
# image: your_market_data_gateway_image:latest
|
|
||||||
# container_name: market_data_gateway
|
|
||||||
# environment:
|
|
||||||
# - REDIS_HOST=redis
|
|
||||||
# volumes:
|
|
||||||
# - ./config:/shared/config
|
|
||||||
# - ./logs:/shared/logs
|
|
||||||
# depends_on:
|
|
||||||
# - redis
|
|
||||||
|
|
||||||
# test_program:
|
# test_program:
|
||||||
# image: your_test_program_image:latest
|
# image: your_test_program_image:latest
|
||||||
|
|||||||
@ -34,7 +34,7 @@ while getopts "c:a:z" opt; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
Cmd="python3.12"
|
Cmd="python3.12"
|
||||||
Cmd="${Cmd} cvttpy/apps/microservices/mkt_data_gateway/md_gateway.py"
|
Cmd="${Cmd} cvttpy/apps/microservices/market_gateways/md_gateway.py"
|
||||||
Cmd="${Cmd} --config=${Config}"
|
Cmd="${Cmd} --config=${Config}"
|
||||||
Cmd="${Cmd} --credentials_file=/.creds"
|
Cmd="${Cmd} --credentials_file=/.creds"
|
||||||
Cmd="${Cmd} --admin_port=${AdminPort}"
|
Cmd="${Cmd} --admin_port=${AdminPort}"
|
||||||
|
|||||||
3
microservices/oe_gateway/.dockerignore
Normal file
3
microservices/oe_gateway/.dockerignore
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
.git
|
||||||
|
**/__pycache__
|
||||||
|
.pipenv
|
||||||
25
microservices/oe_gateway/Dockerfile
Normal file
25
microservices/oe_gateway/Dockerfile
Normal 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
microservices/oe_gateway/run_oegw.sh
Executable file
48
microservices/oe_gateway/run_oegw.sh
Executable 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}
|
||||||
|
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user