I have the fallowing docker-compose file:
version: '3.9'
services:
database:
image: mongo:3.6
restart: on-failure
ports:
- 27017:27017
environment:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: admin
volumes:
- mongo_data:/data/db
server:
restart: on-failure
image: parseplatform/parse-server:5.2.3
ports:
- 1337:1337
- 9229:9229
environment:
- PARSE_SERVER_APPLICATION_ID=$SERVER_APPLICATION_ID
- PARSE_SERVER_APPLICATION_NAME=$SERVER_APPLICATION_NAME
- PARSE_SERVER_MASTER_KEY=$SERVER_MASTER_KEY
- PARSE_SERVER_DATABASE_URI=mongodb://admin:admin@mongo/parse_server?authSource=admin
- PARSE_SERVER_MOUNT_GRAPHQL=true
- PARSE_SERVER_CLOUD=/parse-server/cloud/main.js
- PARSE_SERVER_GRAPH_QLSCHEMA=/parse-server/cloud/schema_2.graphql
links:
- database:mongo
depends_on:
- database
entrypoint: "node --inspect=0.0.0.0:9229 /parse-server/bin/parse-server"
volumes:
- parse_server_cloud:/parse-server/cloud
volumes:
mongo_data:
parse_server_cloud:
driver: local
driver_opts:
type: none
device: ./parse-server/cloud
o: bind
Also, my project structure is like this:
└── parse-server
├── cloud
│ ├── main.js
│ ├── package.json
│ ├── schema_2.graphql
Now, based on this question and this tutorial from back4app I understand that I have to add inside my of my package.json all the external dependencies that I want to have inside of my Parse Server like this:
My package.json
{
"dependencies": {
"meilisearch": "0.32.0"
}
}
And after that, if I will import that based on this documentation like this inside of my main.js
const { MeiliSearch } = require('meilisearch')
Parse.Cloud.define('hello', async (request) => {
return "some text";
});
And also run the docker-compose file like:
docker-compose up -d server
I am going to get this error message inside of my container the fallowing error message:
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'meilisearch'
Require stack:
- /parse-server/cloud/main.js
- /parse-server/lib/ParseServer.js
- /parse-server/lib/index.js
- /parse-server/lib/cli/parse-server.js
- /parse-server/bin/parse-server
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/parse-server/cloud/main.js:1:25) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/parse-server/cloud/main.js',
'/parse-server/lib/ParseServer.js',
'/parse-server/lib/index.js',
'/parse-server/lib/cli/parse-server.js',
'/parse-server/bin/parse-server'
]
}
Do I have to do something else or I am missing something? If any of you could help me I would be really grateful