forked from hashgraph/hedera-json-rpc-relay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (28 loc) · 897 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
FROM node:20-bullseye-slim
# Setup
ENV DEBIAN_FRONTEND=noninteractive
ENV NODE_ENV production
ENV HEALTHCHECK_PORT 7546
EXPOSE 7546
EXPOSE 8546
EXPOSE 8547
HEALTHCHECK --interval=10s --retries=3 --start-period=25s --timeout=2s CMD wget -q -O- http://localhost:${HEALTHCHECK_PORT}/health/liveness
WORKDIR /home/node/app/
COPY package*.json ./
COPY lerna.json ./
COPY --chown=node:node ./packages ./packages
# Install OS updates and required packages
RUN apt-get update && \
apt-get upgrade -y --no-install-recommends && \
apt-get autoremove -y && \
apt-get install --no-install-recommends build-essential -y wget make g++ python3 && \
npm ci --only=production --ignore-scripts && \
npm cache clean --force --loglevel=error && \
chown -R node:node . && \
rm -rf /var/lib/apt/lists/*
USER node
# Build
RUN npm run build
# Run
ENTRYPOINT ["npm", "run"]
CMD ["start"]