feat: Implementa CI/CD para GHCR, define stack Docker de produção e refatora a busca de vetores.
This commit is contained in:
parent
fc75c3c46d
commit
dd7290b36c
@ -10,7 +10,7 @@ module Jasmine
|
|||||||
belongs_to :document, class_name: 'Jasmine::Document'
|
belongs_to :document, class_name: 'Jasmine::Document'
|
||||||
|
|
||||||
# Enable neighbor vector search
|
# Enable neighbor vector search
|
||||||
neighbor_vector :embedding
|
has_neighbors :embedding
|
||||||
|
|
||||||
validates :content, presence: true
|
validates :content, presence: true
|
||||||
validate :validate_consistency
|
validate :validate_consistency
|
||||||
@ -19,7 +19,7 @@ module Jasmine
|
|||||||
|
|
||||||
def validate_consistency
|
def validate_consistency
|
||||||
return if document.nil? || collection.nil?
|
return if document.nil? || collection.nil?
|
||||||
|
|
||||||
errors.add(:base, 'Document mismatch') if document.collection_id != collection_id
|
errors.add(:base, 'Document mismatch') if document.collection_id != collection_id
|
||||||
errors.add(:base, 'Collection account mismatch') if collection.account_id != account_id
|
errors.add(:base, 'Collection account mismatch') if collection.account_id != account_id
|
||||||
errors.add(:base, 'Document account mismatch') if document.account_id != account_id
|
errors.add(:base, 'Document account mismatch') if document.account_id != account_id
|
||||||
|
|||||||
70
docker-stack.prod.yml
Normal file
70
docker-stack.prod.yml
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
rails:
|
||||||
|
image: ghcr.io/${GITHUB_REPOSITORY_OWNER:-your-username}/chatwoot-develop:latest
|
||||||
|
environment:
|
||||||
|
- RAILS_ENV=production
|
||||||
|
- NODE_ENV=production
|
||||||
|
- REDIS_URL=redis://redis:6379
|
||||||
|
- POSTGRES_HOST=postgres
|
||||||
|
- POSTGRES_PORT=5432
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
ports:
|
||||||
|
- '3000:3000'
|
||||||
|
deploy:
|
||||||
|
replicas: 1
|
||||||
|
restart_policy:
|
||||||
|
condition: on-failure
|
||||||
|
depends_on:
|
||||||
|
- postgres
|
||||||
|
- redis
|
||||||
|
|
||||||
|
sidekiq:
|
||||||
|
image: ghcr.io/${GITHUB_REPOSITORY_OWNER:-your-username}/chatwoot-develop:latest
|
||||||
|
command: bundle exec sidekiq -C config/sidekiq.yml
|
||||||
|
environment:
|
||||||
|
- RAILS_ENV=production
|
||||||
|
- NODE_ENV=production
|
||||||
|
- REDIS_URL=redis://redis:6379
|
||||||
|
- POSTGRES_HOST=postgres
|
||||||
|
- POSTGRES_PORT=5432
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
deploy:
|
||||||
|
replicas: 1
|
||||||
|
restart_policy:
|
||||||
|
condition: on-failure
|
||||||
|
depends_on:
|
||||||
|
- postgres
|
||||||
|
- redis
|
||||||
|
|
||||||
|
postgres:
|
||||||
|
image: postgres:12
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
- POSTGRES_DB=chatwoot_production
|
||||||
|
- POSTGRES_USER=postgres
|
||||||
|
- POSTGRES_PASSWORD=postgres
|
||||||
|
volumes:
|
||||||
|
- postgres_data:/var/lib/postgresql/data
|
||||||
|
deploy:
|
||||||
|
placement:
|
||||||
|
constraints:
|
||||||
|
- node.role == manager
|
||||||
|
|
||||||
|
redis:
|
||||||
|
image: redis:6.2-alpine
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- redis_data:/data
|
||||||
|
deploy:
|
||||||
|
placement:
|
||||||
|
constraints:
|
||||||
|
- node.role == manager
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
postgres_data:
|
||||||
|
redis_data:
|
||||||
|
storage:
|
||||||
Loading…
Reference in New Issue
Block a user