Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions bin/init-mongo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
set -e

echo "Starting MongoDB initialization..."
sleep 3

# Create user using local connection (no port specification needed)
echo "Creating user..."
mongosh --eval "
const adminDb = db.getSiblingDB('admin');
try {
adminDb.createUser({
user: 'mongotUser',
pwd: 'mongotPassword',
roles: [{ role: 'searchCoordinator', db: 'admin' }]
});
print('User mongotUser created successfully');
} catch (error) {
if (error.code === 11000) {
print('User mongotUser already exists');
} else {
print('Error creating user: ' + error);
}
}
"
echo "MongoDB initialization completed."
5 changes: 4 additions & 1 deletion config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module.exports = {
ezs: {
url: String(process.env.WORKERS_URL || 'http://localhost:31976'),
verbose: 'ezs:*,-ezs:debug',
timeout: 30000,
timeout: 60000,
cacheEnable: false,
cacheDelay: 60 * 60 * 12,
mainStatement: 'delegate', // use detatch to have a thread dedicated to processing the response, otherwise you can simply use “delegate”
Expand Down Expand Up @@ -94,13 +94,16 @@ module.exports = {
'distribute-by-decadal',
'distribute-by-interval',
'filter',
'join-by',
'similar-by',
'get-fields',
'graph-by',
'segments-precomputed',
'segments-precomputed-nofilter',
'values-precomputed',
'values-precomputed-nofilter',
'raw-precomputed-nofilter',
'vsearch-precomputed',
'group-and-sum-with',
'hello-world',
'istex-facet',
Expand Down
44 changes: 31 additions & 13 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3'

services:
api:
image: node:24.13-alpine
image: node:24.13-slim
extra_hosts: # for linux hosts since version 20.10
- "host.docker.internal:host-gateway"
volumes:
Expand All @@ -18,14 +18,14 @@ services:
EZMASTER_PUBLIC_URL: ${EZMASTER_PUBLIC_URL}
REDIS_URL: 'redis://redis.lodex-net:6379'
WORKERS_URL: 'http://workers.lodex-net:31976'
MONGO_HOST: 'mongo.lodex-net:27017'
MONGO_HOST: 'mongod.lodex-net:27017'
MAILER_HOST: 'maildev.lodex-net:1025'
PRECOMPUTED_URL: 'http://api.lodex-net:3000'
CI: ${CI}
networks:
- lodex-net
depends_on:
- mongo
- mongod
- redis
- workers
- maildev
Expand All @@ -40,7 +40,7 @@ services:
memory: 4G

dev-server: ## Enable hot-reload in development
image: node:24.13-alpine
image: node:24.13-slim
volumes:
- .:/app
working_dir: /app
Expand All @@ -58,21 +58,36 @@ services:
cpus: '2'
memory: 4G

mongo:
image: mongodb/mongodb-community-server:7.0.9-ubi9
logging:
driver: none
command: --quiet
mongod:
image: mongodb/mongodb-community-server:8.2.3-ubi9
command: >-
mongod
--config /etc/mongod.conf
--replSetMember=mongod.lodex-net:27017
ports:
- "27017:27017"
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- mongod_data:/data/db
- ./etc/mongod.conf:/etc/mongod.conf:ro
- ./bin/init-mongo.sh:/docker-entrypoint-initdb.d/init-mongo.sh:ro
networks:
- lodex-net
deploy:
resources:
limits:
cpus: '2'
memory: 1G

qdrant:
image: qdrant/qdrant:v1.17
networks:
- lodex-net
depends_on:
- api
- workers
ports:
- 6333:6333
redis:
image: redis:6
ports:
Expand All @@ -84,9 +99,8 @@ services:
limits:
cpus: '1'
memory: 1G

workers:
image: node:24.13-alpine
image: node:24.13-slim
extra_hosts: # for linux hosts since version 20.10
- "host.docker.internal:host-gateway"
volumes:
Expand All @@ -112,7 +126,7 @@ services:
- lodex-net
command: npm run production:workers
depends_on:
- mongo
- mongod
deploy:
resources:
limits:
Expand All @@ -125,6 +139,10 @@ services:
- "1025:1025"
networks:
- lodex-net
volumes:
mongod_data:
mongot_data:

networks:
lodex-net:
name: lodex-net
2 changes: 1 addition & 1 deletion docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ services:
ports:
- "3000:3000"
mongo:
image: mongodb/mongodb-community-server:7.0.9-ubi9
image: mongodb/mongodb-community-server:8.2.3-ubi9
ports:
- "27017:27017"
2 changes: 1 addition & 1 deletion docker-compose.spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ services:
cpus: '2'
memory: 2G
mongo:
image: mongodb/mongodb-community-server:7.0.9-ubi9
image: mongodb/mongodb-community-server:8.2.3-ubi9
ports:
- "27017:27017"
deploy:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ services:
ports:
- "3000:3000"
mongo:
image: mongodb/mongodb-community-server:7.0.9-ubi9
image: mongodb/mongodb-community-server:8.2.3-ubi9
ports:
- "27017:27017"
10 changes: 10 additions & 0 deletions etc/mongod.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# mongod.conf
storage:
dbPath: /data/db

net:
port: 27017
bindIp: 0.0.0.0

replication:
replSetName: rs0
Loading