Skip to content

Commit

Permalink
feature(Docker): Add extra host, non-essential profile. feature(Core)…
Browse files Browse the repository at this point in the history
…: Clean core_index on db cleanup. (#462)

* Add extra_hosts rule to core service. Add non-essential profile. Clean core_index db object cleanup

* remove extra host rule
  • Loading branch information
jrmyb authored Apr 26, 2024
1 parent 2273a29 commit 58e9a7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/core/src/infra/db/dbUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {ECacheType, ICachesService} from '../../infra/cache/cacheService';
import {IDbService} from './dbService';
import runMigrationFiles from './helpers/runMigrationFiles';
import {IExecuteWithCount} from './_types';
import {CORE_INDEX_FIELD} from '../../infra/indexation/indexationService';

export const MIGRATIONS_COLLECTION_NAME = 'core_db_migrations';

Expand Down Expand Up @@ -204,7 +205,7 @@ export default function ({
return Object.keys(obj).reduce((newObj: any, key) => {
if (key === '_key') {
newObj.id = obj[key];
} else if (key[0] !== '_') {
} else if (key[0] !== '_' && key !== CORE_INDEX_FIELD) {
newObj[key] = obj[key];
}

Expand Down
4 changes: 4 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ services:

# Feel free to comment out logs-collector and elasticsearch if don't need logs
logs-collector:
profiles: ["non-essential"]
image: *node_image
labels:
- traefik.enable=true
Expand Down Expand Up @@ -514,6 +515,7 @@ services:
- traefik.http.services.redis.loadbalancer.server.port=6379

redis-commander:
profiles: ["non-essential"]
container_name: redis-commander
hostname: redis-commander
image: rediscommander/redis-commander:latest
Expand All @@ -531,6 +533,7 @@ services:
- redis

elasticsearch:
profiles: ["non-essential"]
image: elasticsearch:8.10.2
environment:
- discovery.type=single-node
Expand All @@ -541,6 +544,7 @@ services:

## Kibana is used for debugging essentially. Uncommnent following lines if needed
kibana:
profiles: ["non-essential"]
image: kibana:8.10.2
environment:
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
Expand Down

0 comments on commit 58e9a7e

Please sign in to comment.