Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
🐳 Update Dockerfile to read node version from .nvmrc
Browse files Browse the repository at this point in the history
  • Loading branch information
sameersubudhi committed Feb 19, 2024
1 parent f96fd68 commit fb3db28
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 34 deletions.
22 changes: 11 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,37 +77,37 @@ build-images: build-app-registry build-connector build-indexer build-coordinator
build-all: build build-template build-tests

build-app-registry:
cd ./services/blockchain-app-registry && docker buildx build --tag=lisk/service_blockchain_app_registry ./
cd ./services/blockchain-app-registry && docker buildx build --build-arg NODEJS_VERSION=$(shell cat .nvmrc) --tag=lisk/service_blockchain_app_registry ./

build-connector:
cd ./services/blockchain-connector && docker buildx build --tag=lisk/service_blockchain_connector ./
cd ./services/blockchain-connector && docker buildx build --build-arg NODEJS_VERSION=$(shell cat .nvmrc) --tag=lisk/service_blockchain_connector ./

build-indexer:
cd ./services/blockchain-indexer && docker buildx build --tag=lisk/service_blockchain_indexer ./
cd ./services/blockchain-indexer && docker buildx build --build-arg NODEJS_VERSION=$(shell cat .nvmrc) --tag=lisk/service_blockchain_indexer ./

build-coordinator:
cd ./services/blockchain-coordinator && docker buildx build --tag=lisk/service_blockchain_coordinator ./
cd ./services/blockchain-coordinator && docker buildx build --build-arg NODEJS_VERSION=$(shell cat .nvmrc) --tag=lisk/service_blockchain_coordinator ./

build-statistics:
cd ./services/transaction-statistics && docker buildx build --tag=lisk/service_transaction_statistics ./
cd ./services/transaction-statistics && docker buildx build --build-arg NODEJS_VERSION=$(shell cat .nvmrc) --tag=lisk/service_transaction_statistics ./

build-fees:
cd ./services/fee-estimator && docker buildx build --tag=lisk/service_fee_estimator ./
cd ./services/fee-estimator && docker buildx build --build-arg NODEJS_VERSION=$(shell cat .nvmrc) --tag=lisk/service_fee_estimator ./

build-market:
cd ./services/market && docker buildx build --tag=lisk/service_market ./
cd ./services/market && docker buildx build --build-arg NODEJS_VERSION=$(shell cat .nvmrc) --tag=lisk/service_market ./

build-export:
cd ./services/export && docker buildx build --tag=lisk/service_export ./
cd ./services/export && docker buildx build --build-arg NODEJS_VERSION=$(shell cat .nvmrc) --tag=lisk/service_export ./

build-gateway:
cd ./services/gateway && docker buildx build --tag=lisk/service_gateway ./
cd ./services/gateway && docker buildx build --build-arg NODEJS_VERSION=$(shell cat .nvmrc) --tag=lisk/service_gateway ./

build-template:
cd ./services/template && docker buildx build --tag=lisk/service_template ./
cd ./services/template && docker buildx build --build-arg NODEJS_VERSION=$(shell cat .nvmrc) --tag=lisk/service_template ./

build-tests:
cd ./tests && docker buildx build --tag=lisk/service_tests ./
cd ./tests && docker buildx build --build-arg NODEJS_VERSION=$(shell cat .nvmrc) --tag=lisk/service_tests ./

build-local:
yarn install --frozen-lockfile
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ WebSocket-based APIs can be used through the [Socket.IO](https://socket.io/) lib

To continue the installation ensure that you have the following dependencies installed:

- [NodeJS Active LTS - ^v18.16](https://nodejs.org/en/about/releases/)
- [NodeJS Active LTS - ^v18.19.1](https://nodejs.org/en/about/releases/)
- [MySQL - ^v8.0.29](https://dev.mysql.com/doc/relnotes/mysql/8.0/en/)
- [Docker](https://www.docker.com/) with [Docker compose](https://docs.docker.com/compose/install/)
- [GNU Make](https://www.gnu.org/software/make/) and [GNU Tar](https://www.gnu.org/software/tar/)
Expand Down
6 changes: 4 additions & 2 deletions services/blockchain-app-registry/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ARG NODEJS_VERSION=18

##### Stage 1

FROM node:18-alpine AS builder
FROM node:$NODEJS_VERSION-alpine AS builder

RUN adduser -D builder && \
mkdir /home/builder/build && \
Expand All @@ -15,7 +17,7 @@ RUN yarn install --frozen-lockfile

##### Stage 2

FROM node:18-alpine
FROM node:$NODEJS_VERSION-alpine

RUN mkdir -p /home/lisk/lisk-service/blockchain-app-registry/data && \
adduser -D lisk && \
Expand Down
6 changes: 4 additions & 2 deletions services/blockchain-connector/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ARG NODEJS_VERSION=18

##### Stage 1

FROM node:18-alpine AS builder
FROM node:$NODEJS_VERSION-alpine AS builder

RUN apk add --no-cache alpine-sdk=~1 python3=~3 cmake=~3 && \
adduser -D builder && \
Expand All @@ -16,7 +18,7 @@ RUN yarn install --frozen-lockfile

##### Stage 2

FROM node:18-alpine
FROM node:$NODEJS_VERSION-alpine

RUN mkdir -p /home/lisk/lisk-service/blockchain-connector/data && \
adduser -D lisk && \
Expand Down
6 changes: 4 additions & 2 deletions services/blockchain-coordinator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ARG NODEJS_VERSION=18

##### Stage 1

FROM node:18-alpine AS builder
FROM node:$NODEJS_VERSION-alpine AS builder

RUN adduser -D builder && \
mkdir /home/builder/build && \
Expand All @@ -15,7 +17,7 @@ RUN yarn install --frozen-lockfile

##### Stage 2

FROM node:18-alpine
FROM node:$NODEJS_VERSION-alpine

RUN adduser -D lisk && \
chown -R lisk:lisk /home/lisk/
Expand Down
6 changes: 4 additions & 2 deletions services/blockchain-indexer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ARG NODEJS_VERSION=18

##### Stage 1

FROM node:18-alpine AS builder
FROM node:$NODEJS_VERSION-alpine AS builder

RUN adduser -D builder && \
mkdir /home/builder/build && \
Expand All @@ -15,7 +17,7 @@ RUN yarn install --frozen-lockfile

##### Stage 2

FROM node:18-alpine
FROM node:$NODEJS_VERSION-alpine

RUN apk update && apk add --no-cache mysql-client=~10 && \
mkdir -p /home/lisk/lisk-service/blockchain-indexer/data && \
Expand Down
6 changes: 4 additions & 2 deletions services/export/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ARG NODEJS_VERSION=18

##### Stage 1

FROM node:18-alpine AS builder
FROM node:$NODEJS_VERSION-alpine AS builder

RUN adduser -D builder && \
mkdir /home/builder/build && \
Expand All @@ -15,7 +17,7 @@ RUN yarn install --frozen-lockfile

##### Stage 2

FROM node:18-alpine
FROM node:$NODEJS_VERSION-alpine

RUN mkdir -p /home/lisk/lisk-service/export/data && \
adduser -D lisk && \
Expand Down
6 changes: 4 additions & 2 deletions services/fee-estimator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ARG NODEJS_VERSION=18

##### Stage 1

FROM node:18-alpine AS builder
FROM node:$NODEJS_VERSION-alpine AS builder

RUN adduser -D builder && \
mkdir /home/builder/build && \
Expand All @@ -14,7 +16,7 @@ RUN yarn install --frozen-lockfile

##### Stage 2

FROM node:18-alpine
FROM node:$NODEJS_VERSION-alpine

RUN adduser -D lisk && \
chown -R lisk:lisk /home/lisk/
Expand Down
6 changes: 4 additions & 2 deletions services/gateway/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ARG NODEJS_VERSION=18

##### Stage 1

FROM node:18-alpine AS builder
FROM node:$NODEJS_VERSION-alpine AS builder

RUN adduser -D builder && \
mkdir /home/builder/build && \
Expand All @@ -17,7 +19,7 @@ RUN yarn install --frozen-lockfile && \

##### Stage 2

FROM node:18-alpine
FROM node:$NODEJS_VERSION-alpine

RUN apk add --no-cache curl=~8 && \
adduser -D lisk
Expand Down
6 changes: 4 additions & 2 deletions services/market/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ARG NODEJS_VERSION=18

##### Stage 1

FROM node:18-alpine AS builder
FROM node:$NODEJS_VERSION-alpine AS builder

RUN adduser -D builder && \
mkdir /home/builder/build && \
Expand All @@ -15,7 +17,7 @@ RUN yarn install --frozen-lockfile

##### Stage 2

FROM node:18-alpine
FROM node:$NODEJS_VERSION-alpine

RUN adduser -D lisk && \
chown -R lisk:lisk /home/lisk/
Expand Down
6 changes: 4 additions & 2 deletions services/template/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ARG NODEJS_VERSION=18

##### Stage 1

FROM node:18-alpine AS builder
FROM node:$NODEJS_VERSION-alpine AS builder

RUN adduser -D builder && \
mkdir /home/builder/build && \
Expand All @@ -15,7 +17,7 @@ RUN yarn install --frozen-lockfile

##### Stage 2

FROM node:18-alpine
FROM node:$NODEJS_VERSION-alpine

RUN adduser -D lisk && \
chown -R lisk:lisk /home/lisk/
Expand Down
6 changes: 4 additions & 2 deletions services/transaction-statistics/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ARG NODEJS_VERSION=18

##### Stage 1

FROM node:18-alpine AS builder
FROM node:$NODEJS_VERSION-alpine AS builder

RUN adduser -D builder && \
mkdir /home/builder/build && \
Expand All @@ -15,7 +17,7 @@ RUN yarn install --frozen-lockfile

##### Stage 2

FROM node:18-alpine
FROM node:$NODEJS_VERSION-alpine

RUN adduser -D lisk && \
chown -R lisk:lisk /home/lisk/
Expand Down
6 changes: 4 additions & 2 deletions tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ARG NODEJS_VERSION=18

##### Stage 1

FROM node:18-alpine AS builder
FROM node:$NODEJS_VERSION-alpine AS builder

RUN adduser -D builder && \
mkdir /home/builder/build && \
Expand All @@ -14,7 +16,7 @@ RUN yarn install --frozen-lockfile

##### Stage 2

FROM node:18-alpine
FROM node:$NODEJS_VERSION-alpine

RUN adduser -D lisk && \
chown -R lisk:lisk /home/lisk/
Expand Down

0 comments on commit fb3db28

Please sign in to comment.