Skip to content

Commit c49b7a0

Browse files
committed
add dockerfile
1 parent 55c0e6d commit c49b7a0

File tree

3 files changed

+42
-2
lines changed

3 files changed

+42
-2
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
FROM node:18-alpine AS build_base
2+
RUN apk add --no-cache libc6-compat
3+
RUN apk update
4+
WORKDIR /app
5+
RUN npm install turbo --global
6+
7+
FROM build_base AS builder
8+
9+
COPY . .
10+
RUN turbo prune ws-bot-backend --docker
11+
12+
FROM build_base AS installer
13+
14+
COPY .gitignore .gitignore
15+
COPY --from=builder /app/out/json/ .
16+
COPY --from=builder /app/out/package-lock.json ./
17+
RUN npm ci
18+
19+
COPY --from=builder /app/out/full .
20+
COPY turbo.json turbo.json
21+
22+
RUN turbo run build --filter ws-bot-backend...
23+
24+
FROM node:18-alpine AS runner
25+
26+
WORKDIR /app
27+
RUN addgroup --system --gid 1001 ws-bot-backend
28+
RUN adduser --system --uid 1001 ws-bot-backend
29+
USER ws-bot-backend
30+
COPY --from=installer /app .
31+
32+
CMD ["node", "multichannel-app/ws-bot-backend/dist/index.js"]

multichannel-app/ws-bot-backend/src/index.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,15 @@ import { ChatCompletionMessageParam } from 'openai/resources';
1818
const app = ExpressWS(express()).app;
1919
const port = process.env.WS_BOT_PORT;
2020

21-
const speechToTextClient = new speech.SpeechClient();
22-
const ttsClient = new textToSpeech.TextToSpeechClient();
21+
const credentials = {
22+
'type': 'service_account',
23+
'private_key': process.env.GOOGLE_PRIVATE_KEY,
24+
'client_email': process.env.GOOGLE_CLIENT_EMAIL,
25+
'client_id': process.env.GOOGLE_CLIENT_ID,
26+
};
27+
28+
const speechToTextClient = new speech.SpeechClient({ credentials });
29+
const ttsClient = new textToSpeech.TextToSpeechClient({ credentials });
2330

2431
const SizeChunker = chunkingStreams.SizeChunker;
2532

0 commit comments

Comments
 (0)