Skip to content

Commit a44b789

Browse files
feat(search): v1
* chore(search): connect local elasticsearch * chore(search): add application bootstrap migration script * feat(search): elasticsearch seed command * feat(search): elasticsearch seed script * feat(search): search users query * chore(search): edit request, response dto * docs(search): update search swagger * feat(search): tweets index + reset script * fix(search): ELASTICSEARCH_NODE placeholder * feat(search): search posts query * feat(search): posts pagination * feat(search): sync create and update tweet with elasticsearch * feat(search): sync delete tweet with elasticsearch * feat(search): sync update and delete author with elasticsearch * refactor(search): single sync follow job for follower and followed * feat(search): users cursor pagination * feat(search): store parent and conversation id in tweet index * feat(search): attach parent and conversation data * feat(search): media and latest posts * test(search): search controller unit tests * test(search): search service unit tests * fix(search): add repost bg to sync elastic * fix(ci): fix package-lock.json --------- Co-authored-by: Mario Raafat <mariorafat10@gmail.com> Co-authored-by: Mario Raafat <136023677+MarioRaafat@users.noreply.github.com>
1 parent 85fe2d9 commit a44b789

40 files changed

+4614
-777
lines changed

docker/docker-compose.local.yml

Lines changed: 86 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,91 @@
11
services:
2-
api:
3-
build: .
4-
container_name: api
5-
env_file:
6-
- config/local.env
7-
ports:
8-
- "3000:3000"
9-
depends_on:
10-
- redis
11-
- relational_db
12-
- non_relational_db
2+
# api:
3+
# build: .
4+
# container_name: api
5+
# env_file:
6+
# - ../config/local.env
7+
# ports:
8+
# - "3000:3000"
9+
# depends_on:
10+
# - redis
11+
# - relational_db
12+
# - non_relational_db
13+
14+
# redis:
15+
# image: redis
16+
# container_name: redis
17+
# env_file:
18+
# - ../config/local.env
19+
# ports:
20+
# - "${REDIS_PORT}:6379"
1321

14-
redis:
15-
image: redis
16-
container_name: redis
17-
env_file:
18-
- config/local.env
22+
# relational_db:
23+
# image: postgres
24+
# container_name: postgres
25+
# env_file:
26+
# - ../config/local.env
27+
# environment:
28+
# POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
29+
# POSTGRES_USER: "${POSTGRES_USERNAME}"
30+
# POSTGRES_DB: "${POSTGRES_DB}"
31+
32+
# non_relational_db:
33+
# image: mongo:7.0
34+
# container_name: mongo
35+
# env_file:
36+
# - ../config/local.env
37+
elasticsearch:
38+
image: docker.elastic.co/elasticsearch/elasticsearch:8.12.0
39+
container_name: elasticsearch
40+
environment:
41+
node.name: es01
42+
cluster.name: mycluster
43+
discovery.type: single-node
44+
bootstrap.memory_lock: "true"
45+
ES_JAVA_OPTS: -Xms256m -Xmx256m
46+
xpack.security.enabled: "false"
47+
xpack.security.enrollment.enabled: "false"
48+
xpack.security.http.ssl.enabled: "false"
49+
ulimits:
50+
memlock:
51+
soft: -1
52+
hard: -1
1953
ports:
20-
- "${REDIS_PORT}:6379"
54+
- "9200:9200"
55+
- "9300:9300"
56+
volumes:
57+
- esdata:/usr/share/elasticsearch/data
58+
networks:
59+
- elastic
60+
healthcheck:
61+
test: ["CMD-SHELL", "curl -f http://localhost:9200/_cluster/health || exit 1"]
62+
interval: 10s
63+
timeout: 5s
64+
retries: 30
2165

22-
relational_db:
23-
image: postgres
24-
container_name: postgres
25-
env_file:
26-
- config/local.env
66+
kibana:
67+
image: docker.elastic.co/kibana/kibana:8.12.0
68+
container_name: kibana
2769
environment:
28-
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
29-
POSTGRES_USER: "${POSTGRES_USERNAME}"
30-
POSTGRES_DB: "${POSTGRES_DB}"
31-
32-
non_relational_db:
33-
image: mongo:7.0
34-
container_name: mongo
35-
env_file:
36-
- config/local.env
70+
ELASTICSEARCH_HOSTS: http://elasticsearch:9200
71+
ELASTICSEARCH_SSL_VERIFICATIONMODE: none
72+
ports:
73+
- "5601:5601"
74+
depends_on:
75+
elasticsearch:
76+
condition: service_healthy
77+
networks:
78+
- elastic
79+
healthcheck:
80+
test: ["CMD-SHELL", "curl -f http://localhost:5601/api/status || exit 1"]
81+
interval: 30s
82+
timeout: 10s
83+
retries: 5
84+
85+
volumes:
86+
esdata:
87+
driver: local
88+
89+
networks:
90+
elastic:
91+
driver: bridge

0 commit comments

Comments
 (0)