-
Notifications
You must be signed in to change notification settings - Fork 14
Add Dockerfiles and docker-compose.yml #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
PierreMesure
wants to merge
6
commits into
inooLabs:main
Choose a base branch
from
ESVdatalabb:docker-compose
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f9a806d
Add Dockerfiles and docker-compose.yml
PierreMesure ee2d555
Add migration files
PierreMesure 6464d84
Fixing the frontend being inaccessible from within the container
PierreMesure e567882
Merge the backend's network with the frontend so the latter can commu…
PierreMesure e55572a
Adding migrating before starting the server
PierreMesure 4f4ec0e
Add documentation in README
PierreMesure File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -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. | ||
|
|
||
This file contains hidden or 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,19 @@ | ||
| FROM python:3.10-slim | ||
|
|
||
| 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 | ||
This file contains hidden or 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,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 |
This file contains hidden or 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,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"] |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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
gccis not available. It works fine when switching topython:3.10, which should be ok if this is intended for development use. Otherwise installinggccvia apt-get below also works.