Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Dockerfile for the cosmosdb-server service #62

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hectcastro
Copy link

@hectcastro hectcastro commented Jan 6, 2021

This PR includes two distinct changes, but they're split across separate commits in case it isn't desirable to merge both at this time:

  1. Add a Dockerfile that uses Node.js 12.x to install the necessary project dependencies to run cosmosdb-server within a container. In addition, add support to the server itself to gracefully shutdown when given a subset of UNIX signals (e.g., SIGINT, SIGTERM).
  2. Within a separate GitHub Actions workflow, build and publish the project container image to Docker Hub using credentials provided to the GitHub Actions execution context (e.g., DOCKERHUB_USERNAME and DOCKERHUB_TOKEN).

Additionally:

  • An instance of the GitHub Actions run publishing to azavea/cosmosdb-server can be found here.
  • Testing can be accomplished using that same published container image via:
$ docker run --rm azavea/cosmosdb-server:hmc-docker-support
Ready to accept connections at [::]:45751
^CAttempting a graceful shutdown...
Existing connections closed. Exiting...

Fixes #33

Add a Dockerfile that uses Node.js 12.x to install the necessary project
dependencies to run cosmosdb-server within a container. In addition, add
support to the server itself to gracefully shutdown when given a subset
of UNIX signals (e.g., SIGINT, SIGTERM).

on:
push:
tags:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To facilitate testing this workflow in GitHub Actions, this used to listen to pushes on a branch. Before opening the PR, I updated it specifically to listen to pushes on tags.


- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step looks a little over-engineered, but was used because it was the recommended approach to annotating the container image to be published .

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -0,0 +1,13 @@
FROM node:12-slim
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Dockerfile was heavily influenced by the existing WIP changes in master...ridhoq:docker.

Within a separate GitHub Actions workflow, build and publish the project
container image to Docker Hub using credentials provided to the GitHub
Actions execution context.
@hectcastro hectcastro marked this pull request as ready for review January 7, 2021 15:25
@hectcastro hectcastro mentioned this pull request Jan 8, 2021
@nkzawa
Copy link
Contributor

nkzawa commented Jan 26, 2021

Thank you for the PR and sorry for the delay. The PR looks great but it's not ready to merge because we don't have an official account on dockerhub yet. I'm asking if we can prepare one.

@hectcastro
Copy link
Author

No worries! Happy to reengage whenever the DockerHub account gets created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docker image
2 participants