Add Dockerfile for pdfHandler

This commit is contained in:
Hongbo Wu
2022-10-04 15:28:12 +08:00
parent 61303419a0
commit d6e465d482
8 changed files with 52 additions and 2 deletions

View File

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

View File

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

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/pdf-handler/package.json ./packages/pdf-handler/package.json
RUN yarn install --pure-lockfile
ADD /packages/pdf-handler ./packages/pdf-handler
RUN yarn workspace @omnivore/pdf-handler build
# After building, fetch the production dependencies
RUN rm -rf /app/packages/pdf-handler/node_modules
RUN rm -rf /app/node_modules
RUN yarn install --pure-lockfile --production
EXPOSE 8080
CMD ["yarn", "workspace", "@omnivore/pdf-handler", "start"]

View File

@ -20,7 +20,10 @@
"deploy": "yarn build && yarn gcloud-deploy"
},
"devDependencies": {
"@types/node": "^14.11.2"
"@types/node": "^14.11.2",
"chai": "^4.3.6",
"chai-string": "^1.5.0",
"mocha": "^10.0.0"
},
"dependencies": {
"@google-cloud/functions-framework": "3.1.2",

View File

@ -5,5 +5,5 @@
"rootDir": ".",
"lib": ["dom"]
},
"include": ["src", "test"]
"include": ["src"]
}

View File

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

View File

@ -85,6 +85,7 @@ WORKDIR /app
ENV CHROMIUM_PATH /usr/bin/chromium-browser
ENV LAUNCH_HEADLESS=true
ENV PORT 9090
COPY package.json .
COPY yarn.lock .