forked from ethereum/sourcify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (29 loc) · 1.02 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
# Needs to be run from the project root context
FROM node:18.18.2-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:18.18.2-bullseye-slim as production
RUN mkdir -p /home/app/services/monitor
WORKDIR /home/app/services/monitor
COPY services/monitor/package.json ./package.json
COPY services/monitor/chains.json ./chains.json
RUN npm install --omit=dev
COPY --from=builder /home/app/services/monitor/dist ./dist
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", "chains.json" ]