forked from drawrowfly/tiktok-scraper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (22 loc) · 749 Bytes
/
Dockerfile
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
#Building Scraper
FROM alpine:latest AS tiktok_scraper.build
WORKDIR /usr/app
RUN apk update && apk add --update nodejs nodejs-npm python3 pkgconfig pixman-dev
RUN apk add --update cairo-dev pango-dev make g++
COPY package*.json tsconfig.json .prettierrc.js bin ./
COPY ./src ./src
RUN npm i
RUN npm run docker:build
RUN rm -rf src node_modules
#Using Scraper
FROM alpine:latest AS tiktok_scraper.use
WORKDIR /usr/app
RUN apk update && apk add --update nodejs nodejs-npm python3 pkgconfig pixman-dev
RUN apk add --update cairo-dev pango-dev make g++
COPY --from=tiktok_scraper.build ./usr/app ./
COPY ./bin ./bin
COPY package* ./
ENV SCRAPING_FROM_DOCKER=1
RUN mkdir -p files
RUN npm i --production
ENTRYPOINT [ "node", "bin/cli.js" ]