Skip to content

feat: containerize API and add Docker Compose for local full-stack#45

Open
adityabelgaonkar05 wants to merge 4 commits intocogniahq:mainfrom
adityabelgaonkar05:main
Open

feat: containerize API and add Docker Compose for local full-stack#45
adityabelgaonkar05 wants to merge 4 commits intocogniahq:mainfrom
adityabelgaonkar05:main

Conversation

@adityabelgaonkar05
Copy link

Made the API and DB run together with the same Docker Compose command by adding a multi-stage Dockerfile for the API and a docker-compose that initiates api, postgres, qdrant, and redis.

@cla-bot
Copy link

cla-bot bot commented Dec 3, 2025

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @adityabelgaonkar05 on file. In order for us to review and merge your code, please contact the project maintainers to get yourself added.

@cla-bot
Copy link

cla-bot bot commented Dec 3, 2025

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @adityabelgaonkar05 on file. In order for us to review and merge your code, please contact the project maintainers to get yourself added.

Copy link
Member

@virajbhartiya virajbhartiya left a comment

Choose a reason for hiding this comment

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

Also remove so verbose comments

# Find a username associated with UID 1000 (if any) and use it to drop privileges
username=$(awk -F: '$3==1000{print $1; exit}' /etc/passwd 2>/dev/null || true)
if [ -n "$username" ]; then
exec su -s /bin/sh "$username" -c "/qdrant/qdrant $*"
Copy link
Member

Choose a reason for hiding this comment

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

standardise the use of $* and $@

@cla-bot
Copy link

cla-bot bot commented Dec 3, 2025

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @adityabelgaonkar05 on file. In order for us to review and merge your code, please contact the project maintainers to get yourself added.

Comment on lines +14 to +39
environment:
NODE_ENV: ${NODE_ENV:-development}
PORT: 3000
DATABASE_URL: postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@postgres:5432/${POSTGRES_DB:-cognia}
REDIS_URL: redis://redis:6379
QDRANT_URL: http://qdrant:6333
QDRANT_API_KEY: ${QDRANT_API_KEY:-}
EMBEDDING_DIMENSION: ${EMBEDDING_DIMENSION:-768}
EMBED_PROVIDER: ${EMBED_PROVIDER:-ollama}
GEN_PROVIDER: ${GEN_PROVIDER:-gemini}
GEMINI_API_KEY: ${GEMINI_API_KEY:-}
GEMINI_EMBED_MODEL: ${GEMINI_EMBED_MODEL:-text-embedding-004}
OLLAMA_BASE_URL: ${OLLAMA_BASE_URL:-http://host.docker.internal:11434}
OLLAMA_EMBED_MODEL: ${OLLAMA_EMBED_MODEL:-nomic-embed-text}
OLLAMA_GEN_MODEL: ${OLLAMA_GEN_MODEL:-llama3.1:8b}
JWT_SECRET: ${JWT_SECRET:-change-this-secret-in-production}
JWT_EXPIRES_IN: ${JWT_EXPIRES_IN:-7d}
COOKIE_DOMAIN: ${COOKIE_DOMAIN:-.cognia.xyz}
SESSION_COOKIE_NAME: ${SESSION_COOKIE_NAME:-cognia_session}
COOKIE_SECURE: ${COOKIE_SECURE:-false}
CORS_ALLOWED_ORIGINS: ${CORS_ALLOWED_ORIGINS:-http://localhost:5173,http://localhost:3000}
EXTENSION_IDS: ${EXTENSION_IDS:-}
LOGGER_OUTPUT_MODE: ${LOGGER_OUTPUT_MODE:-print}
MORGAN_OUTPUT_MODE: ${MORGAN_OUTPUT_MODE:-print}
LOG_FILE_PATH: ${LOG_FILE_PATH:-./logs/app.log}
NO_COLOR: ${NO_COLOR:-0}
Copy link
Member

Choose a reason for hiding this comment

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

YAML anchors and merge keys can be used instead of duplicating them or prod and dev environments (refer lines 72-96)
the only difference between prod and dev is how the start scipt executes so envs can be reused

Copy link
Member

Choose a reason for hiding this comment

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

Can you also add required: true for variable which aren't optional

… from .env while building, edit docker commands.
@cla-bot
Copy link

cla-bot bot commented Jan 3, 2026

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @adityabelgaonkar05 on file. In order for us to review and merge your code, please contact the project maintainers to get yourself added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants