Add Dockerfile for text-to-speech

This commit is contained in:
Hongbo Wu 2022-10-04 16:01:01 +08:00
parent 4ced49c4f3
commit 1024e5e5d6
4 changed files with 35 additions and 14 deletions

View file

@ -0,0 +1,5 @@
node_modules
build
.env*
Dockerfile
.dockerignore

View file

@ -0,0 +1,27 @@
FROM node:14.18-alpine
# Run everything after as non-privileged user.
WORKDIR /app
COPY package.json .
COPY yarn.lock .
COPY tsconfig.json .
COPY .prettierrc .
COPY .eslintrc .
COPY /packages/text-to-speech/package.json ./packages/text-to-speech/package.json
RUN yarn install --pure-lockfile
ADD /packages/text-to-speech ./packages/text-to-speech
RUN yarn workspace @omnivore/text-to-speech-handler build
# After building, fetch the production dependencies
RUN rm -rf /app/packages/text-to-speech/node_modules
RUN rm -rf /app/node_modules
RUN yarn install --pure-lockfile --production
EXPOSE 8080
CMD ["yarn", "workspace", "@omnivore/text-to-speech-handler", "start"]

View file

@ -25,7 +25,9 @@
"@types/natural": "^5.1.1",
"@types/node": "^14.11.2",
"@types/underscore": "^1.11.4",
"eslint-plugin-prettier": "^4.0.0"
"chai": "^4.3.6",
"eslint-plugin-prettier": "^4.0.0",
"mocha": "^10.0.0"
},
"dependencies": {
"@google-cloud/functions-framework": "3.1.2",

View file

@ -1,13 +0,0 @@
import 'mocha'
import * as chai from 'chai'
import { expect } from 'chai'
import 'chai/register-should'
import chaiString from 'chai-string'
chai.use(chaiString)
describe('Stub test', () => {
it('should pass', () => {
expect(true).to.be.true
})
})