Add Signal and Whatsapp Docker CI
This commit is contained in:
parent
b8ff61265b
commit
6305a8b0bc
12 changed files with 99 additions and 8 deletions
|
|
@ -0,0 +1 @@
|
|||
export { receiveMessage as POST } from "bridge-ui";
|
||||
38
apps/bridge-whatsapp/Dockerfile
Normal file
38
apps/bridge-whatsapp/Dockerfile
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
FROM node:20-bookworm AS base
|
||||
|
||||
FROM base AS builder
|
||||
ARG APP_DIR=/opt/bridge-whatsapp
|
||||
RUN mkdir -p ${APP_DIR}/
|
||||
RUN npm i -g turbo
|
||||
WORKDIR ${APP_DIR}
|
||||
COPY . .
|
||||
RUN turbo prune --scope=bridge-whatsapp --docker
|
||||
|
||||
FROM base AS installer
|
||||
ARG APP_DIR=/opt/bridge-whatsapp
|
||||
WORKDIR ${APP_DIR}
|
||||
COPY --from=builder ${APP_DIR}/out/json/ .
|
||||
COPY --from=builder ${APP_DIR}/out/full/ .
|
||||
COPY --from=builder ${APP_DIR}/out/package-lock.json ./package-lock.json
|
||||
RUN npm ci
|
||||
RUN npm i -g turbo
|
||||
RUN turbo run build --filter=bridge-whatsapp
|
||||
|
||||
FROM base as runner
|
||||
ARG BUILD_DATE
|
||||
ARG VERSION
|
||||
ARG APP_DIR=/opt/bridge-whatsapp
|
||||
RUN mkdir -p ${APP_DIR}/
|
||||
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
dumb-init
|
||||
WORKDIR ${APP_DIR}
|
||||
COPY --from=installer ${APP_DIR} ./
|
||||
RUN chown -R node:node ${APP_DIR}
|
||||
WORKDIR ${APP_DIR}/apps/bridge-whatsapp/
|
||||
RUN chmod +x docker-entrypoint.sh
|
||||
USER node
|
||||
EXPOSE 5000
|
||||
ENV PORT 5000
|
||||
ENV NODE_ENV production
|
||||
ENTRYPOINT ["/opt/bridge-whatsapp/apps/bridge-whatsapp/docker-entrypoint.sh"]
|
||||
5
apps/bridge-whatsapp/docker-entrypoint.sh
Normal file
5
apps/bridge-whatsapp/docker-entrypoint.sh
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
echo "starting bridge-whatsapp"
|
||||
exec dumb-init npm run start
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
"name": "bridge-whatsapp",
|
||||
"version": "0.3.0",
|
||||
"type": "module",
|
||||
"main": "build/main/main.js",
|
||||
"main": "build/main/index.js",
|
||||
"author": "Darren Clarke <darren@redaranj.com>",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"dependencies": {
|
||||
|
|
@ -28,6 +28,7 @@
|
|||
},
|
||||
"scripts": {
|
||||
"build": "tsc -p tsconfig.json",
|
||||
"dev": "tsx src/index.ts"
|
||||
"dev": "tsx src/index.ts",
|
||||
"start": "node build/main/index.js"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import * as Hapi from "@hapi/hapi";
|
|||
import * as AuthBearer from "hapi-auth-bearer-token";
|
||||
import hapiPino from "hapi-pino";
|
||||
import Schmervice from "@hapipal/schmervice";
|
||||
import WhatsappService from "./service";
|
||||
import WhatsappService from "./service.js";
|
||||
import {
|
||||
GetAllWhatsappBotsRoute,
|
||||
GetBotsRoute,
|
||||
|
|
@ -12,7 +12,7 @@ import {
|
|||
UnverifyBotRoute,
|
||||
RefreshBotRoute,
|
||||
CreateBotRoute,
|
||||
} from "./routes";
|
||||
} from "./routes.js";
|
||||
|
||||
const server = Hapi.server({ host: "localhost", port: 5000 });
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import * as Hapi from "@hapi/hapi";
|
||||
import * as Helpers from "./helpers";
|
||||
import Boom from "@hapi/boom";
|
||||
import * as Helpers from "./helpers.js";
|
||||
|
||||
export const GetAllWhatsappBotsRoute = Helpers.withDefaults({
|
||||
method: "get",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type WhatsappService from "./service";
|
||||
import type WhatsappService from "./service.js";
|
||||
|
||||
declare module "@hapipal/schmervice" {
|
||||
interface SchmerviceDecorator {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue