feat: containerize API and add Docker Compose for local full-stack#45
feat: containerize API and add Docker Compose for local full-stack#45adityabelgaonkar05 wants to merge 4 commits intocogniahq:mainfrom
Conversation
|
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. |
|
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. |
virajbhartiya
left a comment
There was a problem hiding this comment.
Also remove so verbose comments
api/qdrant/entrypoint.sh
Outdated
| # 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 $*" |
There was a problem hiding this comment.
standardise the use of $* and $@
|
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. |
api/docker-compose.yml
Outdated
| 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} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Can you also add required: true for variable which aren't optional
… from .env while building, edit docker commands.
|
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. |
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.