forked from Taum/marketbot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile_crawler_communitydb
More file actions
53 lines (42 loc) · 1.44 KB
/
Dockerfile_crawler_communitydb
File metadata and controls
53 lines (42 loc) · 1.44 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# base node image
FROM node:22-alpine3.20 AS base
# Install all node_modules, including dev dependencies
FROM base AS deps
RUN mkdir /app && mkdir /app/prisma
WORKDIR /app
ADD package.json package-lock.json ./
ADD prisma/schema.prisma ./prisma/schema.prisma
# This installs the dependencies from package-lock.json
# (like npm install, but will fail if package.json and package-lock.json are out of sync)
RUN npm ci
RUN npx prisma generate
# Setup production node_modules
FROM base AS production-deps
RUN mkdir /app
WORKDIR /app
COPY --from=deps /app/node_modules /app/node_modules
ADD package.json package-lock.json ./
RUN npm prune --production
# Build the app
FROM base
ENV NODE_ENV=production
# this can be overridden to crawler-all-uniques instead to get uniques without fetching market data
ENV NPM_TASK=crawler
RUN apk add --no-cache git
RUN mkdir /ghcli
WORKDIR /ghcli
RUN wget https://github.com/cli/cli/releases/download/v2.73.0/gh_2.73.0_linux_386.tar.gz -O ghcli.tar.gz
RUN tar --strip-components=1 -xf ghcli.tar.gz
RUN ln -s /ghcli/bin/gh /usr/bin/gh
RUN mkdir -p /usr/local/bin
RUN mkdir /app
WORKDIR /app
COPY --from=deps /app/node_modules /app/node_modules
ADD common ./common
ADD market-crawler ./market-crawler
ADD data ./data
ADD package.json package-lock.json tsconfig.json ./
ADD .env.crawler ./.env
ADD dev-utils/script/gh-community-db.sh /usr/local/bin/gh-community-db
RUN chmod +x /usr/local/bin/gh-community-db
ENTRYPOINT ["gh-community-db"]