eXist-db / node-exist

Interact with eXist DB instances via XML-RPC and REST
MIT License
16 stars 6 forks source link

Upload to DB from inside Docker container #338

Closed rosariofrontino closed 4 months ago

rosariofrontino commented 4 months ago

Hi. With this code I can upload a XML file to the instance of ExistDB I'm connected to without any problem, if executed locally (not on the host the DB is in).

`

const path = collection.concat(data.recordId).concat('.xml'); 

const content = Buffer.from(modifiedXML); 

const fh = await db.documents.upload(content, content.length);

const r = await db.documents.parseLocal(fh, path);

`

However, I'm unable to upload anything when the script is executed from inside a Docker container, as it timeouts during the upload function. From the container I can even correctly ping the IP address of my ExistDB instance. The DB is on a container on the same host

Is it possible to upload from a container? Do I need some more configurations?

Thanks in advance

rosariofrontino commented 4 months ago

Solved by setting both containers on the same network