forked from apify/actor-scrapy-executor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (27 loc) · 1.08 KB
/
Copy pathDockerfile
File metadata and controls
35 lines (27 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM python:stretch
RUN \
apt-get update && \
apt-get install -yqq apt-transport-https
RUN \
echo "deb https://deb.nodesource.com/node_10.x stretch main" > /etc/apt/sources.list.d/nodesource.list && \
wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list && \
wget -qO- https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
apt-get update && \
apt-get install -yqq nodejs yarn && \
pip install -U pip && pip install pipenv && \
npm i -g npm@^6 && \
rm -rf /var/lib/apt/lists/* \
pip install scrapy
COPY . ./
RUN npm install
# replace with pip install apify
RUN pip install requests
RUN pip install scrapy
# Sets path to Chrome executable, this is used by Apify.launchPuppeteer()
ENV APIFY_CHROME_EXECUTABLE_PATH=/usr/bin/google-chrome
# Tell Node.js this is a production environemnt
ENV NODE_ENV=production
# Enable Node.js process to use a lot of memory (actor has limit of 32GB)
ENV NODE_OPTIONS="--max_old_space_size=30000"
CMD node main.js