Skip to content

BrainAPI is a knowledge graph–powered AI memory layer that transforms unstructured data into structured knowledge, enabling intelligent search, recommendations, and contextual memory for AI agents and applications.

ci(deps): removed deps installation on image build pipeline

Christianedeeb88af537
diff --git a/.github/workflows/tags.yaml b/.github/workflows/tags.yaml
index a08b933..ecc4886 100644
--- a/.github/workflows/tags.yaml
+++ b/.github/workflows/tags.yaml
@@ -16,38 +16,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- - name: Set up Python
- uses: actions/setup-python@v4
- with:
- python-version: "3.11"
-
- - name: Install Poetry
- uses: snok/install-poetry@v1
- with:
- version: 1.8.3
- virtualenvs-create: true
- virtualenvs-in-project: true
-
- - name: Load cached venv
- id: cached-poetry-dependencies
- uses: actions/cache@v3
- with:
- path: .venv
- key: venv-${{ runner.os }}-3.11-${{ hashFiles('**/poetry.lock') }}
-
- - name: Install dependencies
- if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- run: |
- poetry lock --no-update
- poetry install --no-root --sync
-
- name: Get version
id: version
run: echo "VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')" >> $GITHUB_OUTPUT
- - name: Sync poetry.lock with pyproject.toml
- run: poetry lock --no-update
-
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
diff --git a/Dockerfile b/Dockerfile
index a157f81..b555639 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,3 +1,4 @@
+# syntax=docker/dockerfile:1.4
FROM python:3.11-slim
ARG BUILD_DATE
@@ -26,16 +27,20 @@ RUN apt-get update && apt-get install -y \
WORKDIR /app
COPY --chown=appuser:appuser pyproject.toml poetry.lock ./
-COPY --chown=appuser:appuser src/ ./src/
-COPY --chown=appuser:appuser entrypoint.sh ./
-RUN chmod +x /app/entrypoint.sh && \
- mkdir -p /app/.cache && \
+RUN --mount=type=cache,target=/root/.cache/pypoetry \
+ --mount=type=cache,target=/root/.cache/pip \
poetry config virtualenvs.in-project true && \
- poetry lock && \
+ mkdir -p .cache && \
+ poetry lock --no-update && \
poetry sync --no-root && \
chown -R appuser:appuser /app
+COPY --chown=appuser:appuser src/ ./src/
+COPY --chown=appuser:appuser entrypoint.sh ./
+
+RUN chmod +x /app/entrypoint.sh
+
USER appuser
EXPOSE 8000
diff --git a/example-docker-compose.yaml b/example-docker-compose.yaml
index 4cd7e81..64345ec 100644
--- a/example-docker-compose.yaml
+++ b/example-docker-compose.yaml
@@ -176,8 +176,7 @@ services:
env_file:
- .env
command: >
- /app/.venv/bin/python
- src.services.api.app:app
+ -m uvicorn src.services.api.app:app
--host 0.0.0.0
--port 8000
--workers 4