Skip to content

Commit d025ad0

Browse files
committed
first commit
0 parents  commit d025ad0

10 files changed

Lines changed: 195 additions & 0 deletions

File tree

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Publish Docker Image
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
ghcr:
9+
runs-on: ubuntu-latest
10+
11+
permissions:
12+
packages: write
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Set up QEMU
19+
uses: docker/setup-qemu-action@v3
20+
21+
- name: Set up Docker Buildx
22+
uses: docker/setup-buildx-action@v3
23+
with:
24+
driver: docker-container
25+
26+
- name: Login to GitHub Container Registry
27+
uses: docker/login-action@v2
28+
with:
29+
registry: ghcr.io
30+
username: ${{ github.actor }}
31+
password: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: Build and push Docker image to GHCR
34+
uses: docker/build-push-action@v3
35+
with:
36+
context: .
37+
push: true
38+
platforms: linux/amd64,linux/arm64,linux/arm/v7
39+
tags: ghcr.io/${{ github.repository }}:latest
40+
41+
dockerhub:
42+
runs-on: ubuntu-latest
43+
44+
steps:
45+
- name: Checkout repository
46+
if: vars.DOCKER_USERNAME != null
47+
uses: actions/checkout@v4
48+
49+
- name: Set up QEMU
50+
if: vars.DOCKER_USERNAME != null
51+
uses: docker/setup-qemu-action@v3
52+
53+
- name: Set up Docker Buildx
54+
if: vars.DOCKER_USERNAME != null
55+
uses: docker/setup-buildx-action@v3
56+
with:
57+
driver: docker-container
58+
59+
- name: Login to Docker Hub
60+
if: vars.DOCKER_USERNAME != null
61+
uses: docker/login-action@v2
62+
with:
63+
username: ${{ vars.DOCKER_USERNAME }}
64+
password: ${{ secrets.DOCKER_PASSWORD }}
65+
66+
- name: Build and push Docker image to Docker Hub
67+
if: vars.DOCKER_USERNAME != null
68+
uses: docker/build-push-action@v3
69+
with:
70+
context: .
71+
push: true
72+
platforms: linux/amd64,linux/arm64,linux/arm/v7
73+
tags: ${{ github.repository }}:latest

.gitignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Node modules
2+
node_modules/
3+
npm-debug.log
4+
yarn-error.log
5+
package-lock.json
6+
pnpm-lock.yaml
7+
yarn.lock
8+
9+
# Environment variables
10+
.env
11+
.env.local
12+
.env.development.local
13+
.env.test.local
14+
.env.production.local
15+
16+
# Logs
17+
logs
18+
*.log
19+
npm-debug.log*
20+
yarn-debug.log*
21+
yarn-error.log*
22+
23+
# OS files
24+
.DS_Store
25+
Thumbs.db
26+
27+
# Editor settings
28+
.vscode/
29+
.idea/
30+
*.swp

Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM node:23.9-slim AS base
2+
ENV NODE_NO_WARNINGS=1
3+
RUN mkdir /app && mkdir /data && chown node:node /app && chown node:node /data
4+
WORKDIR /app
5+
6+
FROM base AS dev
7+
ENV NODE_ENV=development
8+
RUN npm install -g pm2
9+
COPY . .
10+
RUN chown -R node:node /app
11+
USER node
12+
RUN npm install
13+
VOLUME [ "/app" ]
14+
CMD ["pm2-runtime", "ecosystem.config.cjs" ]
15+
16+
FROM base
17+
ENV NODE_ENV=production
18+
COPY index.mjs package.json ./
19+
RUN npm install --omit=dev
20+
COPY schemas schemas
21+
USER node
22+
CMD ["node", "index.mjs" ]

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 TalkOps
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# TalkOps Extension: Boilerplate NodeJS
2+
3+
A TalkOps Extension made to work with [TalkOps](https://talkops.app).
4+
5+
**TalkOps enables real-time voice interaction with applications.**
6+
7+
8+
## Installation
9+
10+
1. Sign in to [TalkOps](https://talkops.app).
11+
2. Search for the `Boilerplate NodeJS` extension.
12+
3. Add the extension and follow the instructions.

ecosystem.config.cjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
apps: [
3+
{
4+
script: 'index.mjs',
5+
watch: true,
6+
ignore_watch: ['node_modules', 'manifest.json', 'README.md'],
7+
autorestart: true,
8+
},
9+
],
10+
}

index.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { Extension } from 'talkops'
2+
import pkg from './package.json' with { type: 'json' }
3+
4+
const extension = new Extension()
5+
.setName('Boilerplate NodeJS')
6+
.setDockerRepository('ghcr.io/talkops/boilerplate-nodejs')
7+
.setVersion(pkg.version)

manifest.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"categories": [],
3+
"dockerRepository": "ghcr.io/talkops/boilerplate-nodejs",
4+
"features": [],
5+
"icon": null,
6+
"installationSteps": [],
7+
"name": "Boilerplate NodeJS",
8+
"sdk": {
9+
"name": "nodejs",
10+
"version": "2.3.3"
11+
},
12+
"version": "1.0.0",
13+
"website": null
14+
}

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"version": "1.0.0",
3+
"dependencies": {
4+
"talkops": "^2.3.0"
5+
}
6+
}

schemas/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)