-
Notifications
You must be signed in to change notification settings - Fork 34
Add a Dockerfile for the cosmosdb-server service #62
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Dockerfile | ||
| node_modules |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "*" | ||
|
|
||
| jobs: | ||
| release: | ||
| name: release | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout commit and fetch tag history | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Docker meta | ||
| id: docker_meta | ||
| uses: crazy-max/ghaction-docker-meta@v1 | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 . |
||
| with: | ||
| images: vercel/cosmosdb-server | ||
| tag-semver: | | ||
| {{version}} | ||
| {{major}}.{{minor}} | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v1 | ||
|
|
||
| - name: Login to DockerHub | ||
| uses: docker/login-action@v1 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These credentials need to be supplied to the GitHub Actions execution context. This can be done at the GitHub repository level, or at the GitHub organization level: |
||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
|
||
| - name: Build and push | ||
| uses: docker/build-push-action@v2 | ||
| with: | ||
| context: . | ||
| file: ./Dockerfile | ||
| push: true | ||
| tags: ${{ steps.docker_meta.outputs.tags }} | ||
| labels: ${{ steps.docker_meta.outputs.labels }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| FROM node:12-slim | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This |
||
|
|
||
| WORKDIR /app | ||
|
|
||
| COPY package.json yarn.lock ./ | ||
|
|
||
| RUN yarn install --production=false --frozen-lockfile | ||
|
|
||
| COPY . . | ||
|
|
||
| RUN yarn run build | ||
|
|
||
| ENTRYPOINT [ "node", "lib/cli.js" ] | ||
There was a problem hiding this comment.
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.