forked from stitionai/devika
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
37 changed files
with
576 additions
and
107 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
.PHONY = setup deps compose-up compose-down compose-destroy | ||
|
||
# to check if docker is installed on the machine | ||
DOCKER := $(shell command -v docker) | ||
DOCKER_COMPOSE := $(shell command -v docker-compose) | ||
deps: | ||
ifndef DOCKER | ||
@echo "Docker is not available. Please install docker" | ||
@echo "try running sudo apt-get install docker" | ||
@exit 1 | ||
endif | ||
ifndef DOCKER_COMPOSE | ||
@echo "docker-compose is not available. Please install docker-compose" | ||
@echo "try running sudo apt-get install docker-compose" | ||
@exit 1 | ||
endif | ||
|
||
setup: | ||
sh +x build | ||
|
||
compose-down: deps | ||
docker volume ls | ||
docker-compose ps | ||
docker images | ||
docker-compose down; | ||
|
||
compose-up: deps compose-down | ||
docker-compose up --build | ||
|
||
compose-destroy: deps | ||
docker images | grep -i devika | awk '{print $$3}' | xargs docker rmi -f | ||
docker volume prune |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
FROM debian:12 | ||
|
||
# setting up build variable | ||
ARG VITE_API_BASE_URL | ||
ENV VITE_API_BASE_URL=${VITE_API_BASE_URL} | ||
|
||
# setting up os env | ||
USER root | ||
WORKDIR /home/nonroot/client | ||
RUN groupadd -r nonroot && useradd -r -g nonroot -d /home/nonroot/client -s /bin/bash nonroot | ||
|
||
# install node js | ||
RUN apt-get update && apt-get upgrade | ||
RUN apt-get install -y build-essential software-properties-common curl sudo wget git | ||
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - | ||
RUN apt-get install nodejs | ||
|
||
# copying devika app client only | ||
COPY ui /home/nonroot/client/ui | ||
COPY src /home/nonroot/client/src | ||
COPY config.toml /home/nonroot/client/ | ||
|
||
RUN cd ui && npm install && npm install -g npm && npm install -g bun | ||
RUN chown -R nonroot:nonroot /home/nonroot/client | ||
|
||
USER nonroot | ||
WORKDIR /home/nonroot/client/ui | ||
|
||
ENTRYPOINT [ "npx", "bun", "run", "dev", "--", "--host" ] |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
FROM debian:12 | ||
|
||
# setting up os env | ||
USER root | ||
WORKDIR /home/nonroot/devika | ||
RUN groupadd -r nonroot && useradd -r -g nonroot -d /home/nonroot/devika -s /bin/bash nonroot | ||
|
||
ENV PYTHONUNBUFFERED 1 | ||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
|
||
# setting up python3 | ||
RUN apt-get update && apt-get upgrade | ||
RUN apt-get install -y build-essential software-properties-common curl sudo wget git | ||
RUN apt-get install -y python3 python3-pip | ||
RUN curl -fsSL https://astral.sh/uv/install.sh | sudo -E bash - | ||
RUN $HOME/.cargo/bin/uv venv | ||
ENV PATH="/home/nonroot/devika/.venv/bin:$HOME/.cargo/bin:$PATH" | ||
RUN echo $PATH | ||
|
||
# copy devika python engine only | ||
RUN $HOME/.cargo/bin/uv venv | ||
COPY requirements.txt /home/nonroot/devika/ | ||
RUN UV_HTTP_TIMEOUT=100000 $HOME/.cargo/bin/uv pip install -r requirements.txt | ||
RUN playwright install --with-deps | ||
|
||
COPY src /home/nonroot/devika/src | ||
COPY config.toml /home/nonroot/devika/ | ||
COPY devika.py /home/nonroot/devika/ | ||
RUN chown -R nonroot:nonroot /home/nonroot/devika | ||
RUN ls -al | ||
|
||
USER nonroot | ||
WORKDIR /home/nonroot/devika | ||
ENV PATH="/home/nonroot/devika/.venv/bin:$HOME/.cargo/bin:$PATH" | ||
RUN mkdir /home/nonroot/devika/db | ||
|
||
ENTRYPOINT [ "python3", "-m", "devika" ] |
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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
version: "3.9" | ||
|
||
services: | ||
ollama-service: | ||
image: ollama/ollama:latest | ||
expose: | ||
- 11434 | ||
ports: | ||
- 11434:11434 | ||
healthcheck: | ||
test: ["CMD-SHELL", "curl -f http://localhost:11434/ || exit 1"] | ||
interval: 5s | ||
timeout: 30s | ||
retries: 5 | ||
start_period: 30s | ||
networks: | ||
- devika-subnetwork | ||
|
||
devika-backend-engine: | ||
build: | ||
context: . | ||
dockerfile: devika.dockerfile | ||
depends_on: | ||
- ollama-service | ||
expose: | ||
- 1337 | ||
ports: | ||
- 1337:1337 | ||
environment: | ||
- OLLAMA_HOST=http://ollama-service:11434 | ||
healthcheck: | ||
test: ["CMD-SHELL", "curl -f http://localhost:1337/ || exit 1"] | ||
interval: 5s | ||
timeout: 30s | ||
retries: 5 | ||
start_period: 30s | ||
volumes: | ||
- devika-backend-dbstore:/home/nonroot/devika/db | ||
networks: | ||
- devika-subnetwork | ||
|
||
devika-frontend-app: | ||
build: | ||
context: . | ||
dockerfile: app.dockerfile | ||
args: | ||
- VITE_API_BASE_URL=http://127.0.0.1:1337 | ||
depends_on: | ||
- devika-backend-engine | ||
expose: | ||
- 3000 | ||
ports: | ||
- 3000:3000 | ||
networks: | ||
- devika-subnetwork | ||
|
||
networks: | ||
devika-subnetwork: | ||
|
||
volumes: | ||
devika-backend-dbstore: |
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 |
---|---|---|
|
@@ -20,4 +20,5 @@ keybert | |
GitPython | ||
netlify-py | ||
Markdown | ||
xhtml2pdf | ||
xhtml2pdf | ||
groq |
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
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
Oops, something went wrong.