diff --git a/.dockerignore b/.dockerignore index 88dae17..226db07 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,4 +2,5 @@ test run.log docs -.git \ No newline at end of file +.git +data \ No newline at end of file diff --git a/.gitignore b/.gitignore index fd4834b..7dc2a2c 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,7 @@ __pycache__/ # C extensions *.so - +data # Distribution / packaging .Python diff --git a/Dockerfile b/Dockerfile index 7fb97e5..2f4720e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,16 @@ FROM python:3.10-slim AS builder RUN apt update && apt install build-essential -y +RUN apt-get install -y npm COPY ./requirements.txt . + RUN pip install --upgrade --no-cache-dir pip && pip install --no-cache-dir -r requirements.txt -FROM python:3.10-slim +RUN npm install pm2 -g + +COPY ./start.sh . ENV WORKDIR /app WORKDIR $WORKDIR + +FROM python:3.10-slim ADD . $WORKDIR COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages +ENTRYPOINT ["sh","./start.sh"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index fd4b352..feee8b8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,6 @@ version: '3.9' services: llmbot: image: sudoskys/llmbot:latest - command: python3 start_sender.py&python3 start_receiver.py depends_on: - redis - rabbitmq diff --git a/pm2.json b/pm2.json new file mode 100644 index 0000000..66d2564 --- /dev/null +++ b/pm2.json @@ -0,0 +1,20 @@ +{ + "apps": [ + { + "name": "sender", + "script": "python3 start_sender.py", + "instances": 1, + "error_file": "sender.log", + "out_file": "sender.log", + "log_date_format": "YYYY-MM-DD HH-mm-ss" + }, + { + "name": "receiver", + "script": "python3 start_receiver.py", + "instances": 1, + "error_file": "receiver.log", + "out_file": "receiver.log", + "log_date_format": "YYYY-MM-DD HH-mm-ss" + } + ] +} diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..3921f3a --- /dev/null +++ b/start.sh @@ -0,0 +1,2 @@ +python3 start_receiver.py & +python3 start_sender.py