Kumar Shubham
Kumar Shubham

Reputation: 504

General help: Building docker container with node.js

Motivation:

I have an online API, and for every request I need to make a new docker container and execute the code I receive in the request and then delete the docker container. I have thought about using this image as the standard image for docker in order to keep it lightweight.

Questions:

Upvotes: 0

Views: 37

Answers (1)

Vipin Kumar
Vipin Kumar

Reputation: 6546

  • Is it a good method? Since I am worried about the memory usage this method may take. However, I plan to run at most 5 containers at a time and queue all the other requests.

Yes this is good method and you can put limit for resource utilisation for docker containers.

Ref: https://docs.docker.com/engine/admin/resource_constraints/#--memory-swap-details

  • Second, what other ways are there to securely make an online compiling API. I researched on the web and found this docker method very interesting since it removes any chance of abusing to the server with a malicious code that a person can write!

I would suggest you to go with virtualisation, otherwise there will be always be a security risk. And docker is best choice for that. Other option is Vagrant, but it will be heavy on resources.

Upvotes: 1

Related Questions