-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
79f6c97
commit 7160213
Showing
4 changed files
with
22 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,33 @@ | ||
# Stage 1: Compile image | ||
FROM python:3.10-slim-bullseye AS compile-image | ||
WORKDIR /app | ||
|
||
RUN apt-get update && \ | ||
RUN apt-get update && \ | ||
apt-get install --no-install-recommends -y wget libpq-dev gcc g++ python3-dev && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN python -m venv /opt/venv | ||
# Make sure we use the virtualenv: | ||
ENV PATH="/opt/venv/bin:$PATH" | ||
|
||
COPY requirements.txt . | ||
RUN pip install --upgrade pip | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
RUN pip install --upgrade pip && \ | ||
pip install --no-cache-dir -r requirements.txt | ||
|
||
COPY . . | ||
COPY entrypoint.sh ./entrypoint.sh | ||
COPY wait-for-it.sh ./wait-for-it.sh | ||
RUN chmod +x ./entrypoint.sh ./wait-for-it.sh | ||
|
||
# Downloads the tools | ||
RUN python superagi/tool_manager.py | ||
|
||
# Set executable permissions for install_tool_dependencies.sh | ||
RUN chmod +x install_tool_dependencies.sh | ||
|
||
# Install dependencies | ||
RUN ./install_tool_dependencies.sh | ||
RUN chmod +x ./entrypoint.sh ./wait-for-it.sh ./install_tool_dependencies.sh ./entrypoint_celery.sh | ||
|
||
# Stage 2: Build image | ||
FROM python:3.10-slim-bullseye AS build-image | ||
WORKDIR /app | ||
RUN apt-get update && apt-get install --no-install-recommends -y libpq-dev && \ | ||
|
||
RUN apt-get update && \ | ||
apt-get install --no-install-recommends -y libpq-dev && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
COPY --from=compile-image /opt/venv /opt/venv | ||
COPY --from=compile-image /app /app | ||
|
||
# Make sure we use the virtualenv: | ||
ENV PATH="/opt/venv/bin:$PATH" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
#!/bin/bash | ||
Xvfb :0 -screen 0 1280x1024x24 & | ||
x11vnc -display :0 -N -forever -shared & | ||
|
||
exec "$@" | ||
# Downloads the tools | ||
python superagi/tool_manager.py | ||
|
||
# Install dependencies | ||
./install_tool_dependencies.sh | ||
|
||
exec celery -A superagi.worker worker --beat --loglevel=info |