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

chore(deps): more dependencies and docker #74

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Bug report
about: Create a bug report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
<!-- A clear and concise description of what the bug is. -->

**To Reproduce**
<!-- List the steps that can be used to demonstrate the bug. Include the name of the service and operation that you're trying to invoke, if applicable. Be sure to describe any relevant info regarding parameter values used with your API invocation. -->

**Expected behavior**
<!-- A clear and concise description of what you expected to happen. -->

**Screenshots**
<!-- If applicable, add screenshots to help explain your problem. -->

**Must gather (please complete the following information):**
- SDK Version [e.g. 1.2.1]
- Node.js Version [e.g. Node.js 18]
- Name of service that you're trying to use (if applicable)
- Name of operation that you're trying to invoke (if applicable)

**Additional context**
<!-- Add any other context about the problem here.
Were you able to avoid the problem by changing your application code slightly? -->
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->

**Describe the solution you'd like**
<!-- A clear and concise description of what you want to happen. -->

**Describe alternatives you've considered**
<!-- A clear and concise description of any alternative solutions or features you've considered. -->

**Additional context**
<!-- Add any other context or screenshots about the feature request here. -->
42 changes: 42 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,45 @@ jobs:
- run: npm ci
- run: npm run build --if-present
- run: npm test

docker:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup QEMU
uses: docker/setup-qemu-action@v1
- name: Setup docker builds
uses: docker/setup-buildx-action@v1

- name: loging to ghcr
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{github.repository_owner}}
password: ${{secrets.GITHUB_TOKEN}}

- name: Docker meta
id: tekton-lint
uses: docker/metadata-action@v3
with:
images: ghcr.io/ibm/tekton-lint
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha

- name: build and push
uses: docker/build-push-action@v2
with:
context: .
# platforms: linux/amd64,linux/arm/v7,linux/arm64
latforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.onviffmqtt.outputs.tags }}
labels: ${{ steps.onviffmqtt.outputs.labels }}
33 changes: 28 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
FROM node:12.16.3-alpine
WORKDIR /src
COPY . /src
RUN npm ci --prod
ENTRYPOINT ["node", "lint.js"]
#
# SPDX-License-Identifier: Apache-2.0
#
FROM node:18 AS builder

WORKDIR /usr/src/app

# Copy node.js source and build, changing owner as well
COPY --chown=node:node . /usr/src/app
RUN npm ci && npm run build && npm shrinkwrap

FROM node:16 AS production

# Setup tini to work better handle signals
ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini

WORKDIR /usr/src/app
COPY --chown=node:node --from=builder /usr/src/app/lib ./lib
COPY --chown=node:node --from=builder /usr/src/app/package.json ./
COPY --chown=node:node --from=builder /usr/src/app/npm-shrinkwrap.json ./

USER node
ENV NODE_ENV=production
WORKDIR /usr/src/app
# ENTRYPOINT [ "/tini", "--", "node","lib/main.js" ]
ENTRYPOINT [ "node","lib/main.js" ]
Loading
Loading