Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: Lu Ken <[email protected]>
  • Loading branch information
kenplusplus committed Dec 31, 2024
1 parent d6c7338 commit bcf5efb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
FROM python:3.11

RUN apt update -y && apt install -y python3 python3-pip git && apt clean -y
RUN apt update -y && apt install -y python3 python3-pip && apt clean -y

ENV PIP_MIRROR="-i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"
ENV GENTRADE_CACHE_DIR="/app/cache/"
ENV GENTRADE_CACHE_DIR=/app/cache/

ADD . /app/GenTradeServer
ADD cache /app/cache/
RUN git clone https://github.com/TrustWiseAgent/GenTrade /app/GenTrade

ENV PYTHONPATH=/app/GenTrade/src/:/app/GenTradeServer/src/
RUN pip install gentrade==0.0.17

ENV PYTHONPATH=/app/GenTradeServer/src/

VOLUME [ "/app/cache/" ]
WORKDIR /app/GenTradeServer/src/
Expand Down
8 changes: 8 additions & 0 deletions src/gentrade_server/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
The main entry
"""
import sys
import logging
from contextlib import asynccontextmanager

Expand Down Expand Up @@ -29,6 +30,13 @@ async def lifespan(_:FastAPI):
yield
LOG.info("Shutting Down...")

def receive_signal(signalNumber, _):
"""
Quit on Control + C
"""
LOG.info('Received Signal: %d', signalNumber)
sys.exit()

app = FastAPI()
app = FastAPI(lifespan=lifespan)
app.add_middleware(
Expand Down

0 comments on commit bcf5efb

Please sign in to comment.