-
Notifications
You must be signed in to change notification settings - Fork 399
/
Dockerfile
44 lines (32 loc) · 1.22 KB
/
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
35
36
37
38
39
40
41
42
43
44
# Needs to be run from the project root context e.g. `cd sourcify/ && docker build -f services/monitor/Dockerfile .`
FROM node:22.5.1-bullseye as builder
RUN mkdir -p /home/app
WORKDIR /home/app
COPY . .
RUN npm ci --workspace=sourcify-monitor --include-workspace-root
RUN npx lerna run build --scope sourcify-monitor
######################
## Production image ##
######################
FROM node:22.5.1-bullseye-slim as production
RUN mkdir -p /home/app/services/monitor
WORKDIR /home/app/
COPY package.json ./package.json
COPY package-lock.json ./package-lock.json
COPY lerna.json ./lerna.json
COPY nx.json ./nx.json
COPY --from=builder /home/app/packages/ ./packages/
COPY --from=builder /home/app/services/monitor/ ./services/monitor/
RUN npm ci --workspace=sourcify-monitor --include-workspace-root --omit=dev
LABEL org.opencontainers.image.source https://github.com/ethereum/sourcify
LABEL org.opencontainers.image.licenses MIT
ARG ALCHEMY_API_KEY
ARG INFURA_API_KEY
ARG CF_ACCESS_CLIENT_ID
ARG CF_ACCESS_CLIENT_SECRET
# Set default value for ARG
ARG NODE_ENV=production
# Set environment variable
ENV NODE_ENV=${NODE_ENV}
WORKDIR /home/app/services/monitor
CMD ["node", "dist/index.js", "--chainsPath", "monitorChains.json" ]