From b8737c0f6ddfa748b4ab4711d141c442f9c13f07 Mon Sep 17 00:00:00 2001 From: Lucas Vieira Date: Sat, 28 Dec 2024 03:11:30 -0300 Subject: [PATCH] add ai to monolith docker image --- .dockerignore | 1 + docker/Dockerfile | 12 +++++++++++- docker/supervisord.conf | 14 ++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index e1d3549c..9bf4d96a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,3 +6,4 @@ node_modules dist .next venv +*/venv diff --git a/docker/Dockerfile b/docker/Dockerfile index 5a3ab191..4801e866 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -24,6 +24,7 @@ RUN apt-get update && apt-get install -y \ curl \ supervisor \ libaio1 \ + gcc \ alien && \ apt-get clean && rm -rf /var/lib/apt/lists/* @@ -136,6 +137,16 @@ RUN /app/jupyter/venv/bin/pip install /usr/src/jupyter_briefer_extension RUN /app/jupyter/venv/bin/jupyter server extension enable jupyter_briefer_extension --sys-prefix ##### END OF JUPYTER BUILD ##### +### START OF AI SERVICE BUILD ### +WORKDIR /app/ai + +COPY ai/. . + +RUN python3 -m venv /app/ai/venv +RUN /app/ai/venv/bin/pip install --upgrade pip +RUN /app/ai/venv/bin/pip install --no-cache-dir -r requirements.txt +### END OF AI SERVICE BUILD ### + WORKDIR /app RUN groupadd -r briefer \ @@ -151,7 +162,6 @@ RUN groupadd -r briefer \ && chown -R jupyteruser:jupyteruser /app/jupyter/venv \ && chmod 700 /home/jupyteruser - #### START OF COPY API AND WEB BUILDS #### WORKDIR /app/api COPY --from=api-installer --chown=briefer:briefer /app . diff --git a/docker/supervisord.conf b/docker/supervisord.conf index 0272c94f..23b23815 100644 --- a/docker/supervisord.conf +++ b/docker/supervisord.conf @@ -87,3 +87,17 @@ stderr_logfile=/dev/stderr stdout_logfile_maxbytes=0 stderr_logfile_maxbytes=0 priority=7 + +[program:ai] +command=./venv/bin/python ai.py +directory=/app/setup/ +user=briefer +environment=HOME="/home/briefer",USER="briefer" +autostart=true +autorestart=false +startsecs=0 +priority=8 +stdout_logfile=/dev/stdout +stderr_logfile=/dev/stderr +stdout_logfile_maxbytes=0 +stderr_logfile_maxbytes=0