Browse Source

feat: add contracts provider Dockerfile and Makefile targets

develop
Apostolos Fanakis 4 years ago
parent
commit
bfed2e5112
  1. 1
      .gitignore
  2. 9
      docker/Makefile
  3. 34
      docker/concordia-contracts-provider/Dockerfile
  4. 1
      docker/env/contracts-provider.env

1
.gitignore

@ -22,6 +22,7 @@ yarn-error.log*
# Docker volumes
docker/volumes
docker/ganache/volumes
docker/concordia-contracts-provider/volumes
docker/reports
# Misc

9
docker/Makefile

@ -2,6 +2,7 @@
PACKAGES := $(abspath ${CURDIR}/../packages)
REPORTS := $(abspath ${CURDIR}/reports)
GANACHE_VOLUMES := $(abspath ${CURDIR}/ganache/volumes)
CONTRACTS_PROVIDER_VOLUMES := $(abspath ${CURDIR}/concordia-contracts-provider/volumes)
DOCKER_BUILDKIT = 1
run: compose-run build-contracts-migrate run-contracts-migrate build-app run-app
@ -72,6 +73,14 @@ run-app-staging:
run-app-host-chain:
@docker run -d --env-file=./env/concordia.env --name concordia-app --net=host ecentrics/concordia-app:latest
# Contracts provider targets
build-contracts-provider:
@docker build ../ -f ./concordia-contracts-provider/Dockerfile -t ecentrics/concordia-contracts-provider --build-arg TZ=Europe/Athens
run-contracts-provider-staging:
@docker run -d -v ${CONTRACTS_PROVIDER_VOLUMES}/contracts:/data/contracts --env-file=./env/contracts-provider.env -e NODE_ENV=production -p 8400:8400 --name concordia-contracts-provider ecentrics/concordia-contracts-provider:latest
run-contracts-provider:
@docker run -d -v ${CONTRACTS_PROVIDER_VOLUMES}/contracts:/data/contracts --env-file=./env/contracts-provider.env -p 8400:8400 --name concordia-contracts-provider ecentrics/concordia-contracts-provider:latest
# Other
clean-images:
@docker rmi `docker images -q -f "dangling=true"`

34
docker/concordia-contracts-provider/Dockerfile

@ -0,0 +1,34 @@
# --------------------------------------------------
# Stage 1 (Runtime)
# --------------------------------------------------
FROM node:14-alpine as runtime
LABEL maintainers.1="Apostolos Fanakis <apostolof@auth.gr>"
LABEL maintainers.2="Panagiotis Nikolaidis <ezerous@gmail.com>"
LABEL gr.thmmy.ecentrics.concordia-image.name="contracts-provider"
# Fix timezome (needed for timestamps on report files)
ARG TZ
RUN apk add -U tzdata \
&& cp /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo $TZ > /etc/timezone \
&& apk del tzdata \
&& rm -rf /var/cache/apk/*
WORKDIR /usr/src/concordia
# Copy the root package.json and yarn.lock
COPY ./package.json .
COPY ./yarn.lock .
# Copy the contracts provider package.json, then install modules
COPY ./packages/concordia-contracts-provider/package.json ./packages/concordia-contracts-provider/
RUN yarn install --frozen-lockfile --network-timeout 100000
# Gets the rest of the source code
COPY ./packages/concordia-contracts-provider ./packages/concordia-contracts-provider
WORKDIR /usr/src/concordia/packages/concordia-contracts-provider
ENTRYPOINT ["yarn", "start"]

1
docker/env/contracts-provider.env

@ -0,0 +1 @@
UPLOAD_CONTRACTS_DIRECTORY=/data/contracts/
Loading…
Cancel
Save