dockerfile/examples/omnivore/content-fetch/Dockerfile

45 lines
1.1 KiB
Docker
Raw Normal View History

2024-03-15 14:52:38 +08:00
FROM node:18.19.0
# Installs latest Chromium (92) package.
RUN apt-get update && apt-get install -y \
chromium \
ca-certificates \
nodejs \
yarn \
g++ \
make \
python3
WORKDIR /app
ENV CHROMIUM_PATH /usr/bin/chromium
ENV LAUNCH_HEADLESS=true
COPY ./package.json .
COPY ./yarn.lock .
COPY ./tsconfig.json .
COPY ./.prettierrc .
COPY ./.eslintrc .
COPY ./readabilityjs/package.json ./packages/readabilityjs/package.json
COPY ./content-handler/package.json ./packages/content-handler/package.json
COPY ./puppeteer-parse/package.json ./packages/puppeteer-parse/package.json
RUN yarn install --pure-lockfile
ADD ./content-fetch ./packages/content-fetch
ADD ./content-handler ./packages/content-handler
ADD ./puppeteer-parse ./packages/puppeteer-parse
ADD ./readabilityjs ./packages/readabilityjs
RUN yarn workspace @omnivore/content-handler build
# After building, fetch the production dependencies
RUN rm -rf /app/packages/content-fetch/node_modules
RUN rm -rf /app/node_modules
RUN yarn install --pure-lockfile --production
EXPOSE 8080
CMD ["yarn", "workspace", "@omnivore/content-fetch", "start"]