Skip to content

Commit

Permalink
add ai to monolith docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
vieiralucas committed Dec 28, 2024
1 parent 8769afd commit b8737c0
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ node_modules
dist
.next
venv
*/venv
12 changes: 11 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/*

Expand Down Expand Up @@ -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 \
Expand All @@ -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 .
Expand Down
14 changes: 14 additions & 0 deletions docker/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b8737c0

Please sign in to comment.