cosmosdb-server icon indicating copy to clipboard operation
cosmosdb-server copied to clipboard

Docker image

Open ridhoq opened this issue 4 years ago • 12 comments

Any interest in publishing a docker image for this? I'm using this Dockerfile in an integration testing story via docker-compose and it appears to be working great

ridhoq avatar May 19 '20 05:05 ridhoq

That sounds a good idea 👍

nkzawa avatar May 21 '20 12:05 nkzawa

Excellent! One open question for me is to set up the GitHub action to publish to the zeit DockerHub. Should I open the PR with only the Dockerfile or can you help me get the necessary permissions to push the Docker image?

ridhoq avatar May 21 '20 16:05 ridhoq

@ridhoq sorry for the delay. I think it's great if we can push Docker image via github action, maybe using https://github.com/docker/build-push-action. I think I can prepare the credentials for it. Dockerfile only also is helpful 👍

nkzawa avatar May 25 '20 11:05 nkzawa

@nkzawa actually I am having one issue with the docker image - when I run docker run --rm ridhoq/cosmosdb-server:0.7.0, I am unable to use ctrl+c to exit the running container. Do you know why that might be? If this is an issue, it may not be a great experience for users...

ridhoq avatar May 28 '20 22:05 ridhoq

@ridhoq I think it's because node doesn't handle signals.

See https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md#handling-kernel-signals

A solution is to use tini (https://github.com/krallin/tini#using-tini). Using npm also seems work according to https://stackoverflow.com/questions/36637912/how-to-stop-running-node-in-docker

nkzawa avatar May 30 '20 03:05 nkzawa

@nkzawa You just add signal handling to src/index.ts, like so:

const cleanUp = () => {
   // do clean-up stuff
   process.exit(0);
};

process.on('SIGINT', cleanUp);
process.on('SIGTERM', cleanUp);

I can make a PR if you want.

iensu avatar Jun 03 '20 12:06 iensu

Any updates on the Docker image? :)

dzoech avatar Jul 02 '20 19:07 dzoech

I am definitely interested in a Docker image for this. Anyone here still working on it?

RohanNagar avatar Sep 16 '20 19:09 RohanNagar

Sorry I fell off this ticket: I was using this Docker image for a personal project and got sidetracked. This has now come up for a work project so I'd like to get the ball rolling here again.

So the few threads of work remaining here:

  1. Get the Dockerfile merged: I already have that in my fork of the project so it should be nearly good to go
  2. Figure out how to publish the Dockerfile to Vercel's Docker Hub registry. @nkzawa said they could help with this. I'd prefer if someone from Vercel could take point on this as we'd want to manage versioning of the Docker images.
  3. Handle signals like SIGINT and SIGTERM, so we can ctrl-c out of running images, etc. This could prolly be broken out into a separate issue.

Let me know if we're good to proceed with the above work.

ridhoq avatar Nov 16 '20 17:11 ridhoq

Hi all, I just wanted mention in this thread that I made an attempt to address the requirements @ridhoq laid out. Ready and willing to make changes to the PR as needed.

hectcastro avatar Jan 08 '21 12:01 hectcastro

+1 for this one, we would be very interested in using this

jfurmankiewiczpros avatar May 02 '22 18:05 jfurmankiewiczpros