Skip to content

Commit

Permalink
added food outlet
Browse files Browse the repository at this point in the history
  • Loading branch information
Kunalpal215 committed Jun 28, 2023
1 parent df6b25a commit f5d5e31
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
14 changes: 7 additions & 7 deletions api/javascript/Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Final stage
FROM node:slim

FROM node:18-slim
# We don't need the standalone Chromium
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true

# Install Google Chrome Stable and fonts
# Note: this installs the necessary libs to make the browser work with Puppeteer.
RUN apt-get update && apt-get install curl gnupg -y \
&& curl --location --silent https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
&& apt-get install google-chrome-stable -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install gnupg wget -y && \
wget --quiet --output-document=- https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/google-archive.gpg && \
sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \
apt-get update && \
apt-get install google-chrome-stable -y --no-install-recommends && \
rm -rf /var/lib/apt/lists/*

ARG PORT=9010

Expand Down
3 changes: 2 additions & 1 deletion api/javascript/models/foodOutlets.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ foodOutletsSchema.pre('save',async function(){
console.log(this.menu);
const google = new Scraper({
puppeteer: {
executablePath: '/usr/bin/google-chrome',
headless: true,
args: [
"--disable-gpu",
Expand All @@ -71,7 +72,7 @@ foodOutletsSchema.pre('save',async function(){
]
}
});

console.log("BEFORE SCRAPE");
const imageResults1 = await google.scrape("pizza",1);
console.log("AFTER SCRAPE");
Expand Down

0 comments on commit f5d5e31

Please sign in to comment.