Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,21 @@ To run the frontend for this project locally, follow these steps:
6. Run `pnpm -w run dev` to start the project for development.
7. Navigate to `localhost:3000` and login with email `[email protected]` and password `Password1!` (provided you have run the setup steps for the backend).

### Experimental: Run with Docker Compose

You can also spin up Intric by using [docker-compose](https://docs.docker.com/compose/):

```bash
# Clone the repository
git clone https://github.com/inooLabs/intric-release.git
# Create env files for backend and frontend
# You can add your API keys there and adjust the settings
cp backend/.env.template backend/.env
cp frontend/apps/web/.env.example frontend/apps/web/.env

docker compose up
```

## Contribution guidelines

Coming soon.
Expand Down
19 changes: 19 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM python:3.10-slim
Copy link
Contributor

@axelander axelander Dec 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get an error that gcc is not available. It works fine when switching to python:3.10, which should be ok if this is intended for development use. Otherwise installing gcc via apt-get below also works.


WORKDIR /app

RUN apt-get update && apt-get install -y libmagic1 ffmpeg && rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir poetry

COPY poetry.lock pyproject.toml ./
COPY /src ./src

RUN poetry install

COPY /alembic ./alembic
COPY init_db.py alembic.ini ./
COPY .env ./.env

EXPOSE 8123

CMD poetry run python init_db.py && poetry run start
60 changes: 60 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
services:
intric-frontend:
container_name: intric-frontend
build: ./frontend
image: inoolabs/intric-frontend:v0.1
restart: unless-stopped
network_mode: "service:intric-backend"
depends_on:
- intric-backend

intric-backend:
container_name: intric-backend
build: ./backend
image: inoolabs/intric-backend:v0.1
restart: unless-stopped
networks:
- intric
ports:
- 3000:3000
- 8123:8123
depends_on:
intric-redis:
condition: service_started
intric-db:
condition: service_healthy
environment:
- POSTGRES_HOST=intric-db
- REDIS_HOST=intric-redis

intric-db:
container_name: intric-db
image: pgvector/pgvector:pg13
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"] # Healthcheck command for the database
interval: 5s # Time between health checks
timeout: 5s # Time to wait for a health check to succeed
retries: 5 # Number of retries before considering the service unhealthy
env_file:
- ./backend/.env
networks:
- intric
volumes:
- postgres_data:/var/lib/postgresql/data

intric-redis:
container_name: intric-redis
image: redis
networks:
- intric
volumes:
- redis_data:/data

volumes:
postgres_data:
redis_data:

networks:
intric:
name: intric
18 changes: 18 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Use Node.js v20 as the base image
FROM node:20-slim

WORKDIR /app

RUN npm install -g [email protected]

COPY package.json pnpm-lock.yaml pnpm-workspace.yaml setup.sh ./
COPY apps/ ./apps/
COPY packages/ ./packages/

RUN pnpm run setup

WORKDIR /app/apps/web

EXPOSE 3000

CMD ["pnpm", "-w", "run", "dev"]
1 change: 1 addition & 0 deletions frontend/apps/web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default defineConfig({
},
server: {
port: 3000,
host: '0.0.0.0',
strictPort: true
},
define: {
Expand Down