From e526ce32abad354e0359ba083e9797c0617f9106 Mon Sep 17 00:00:00 2001 From: Lucas Gabriel Vuotto Date: Fri, 3 Jun 2022 20:01:22 +0000 Subject: [PATCH] Rework Dockerfile --- Dockerfile | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 372ae0840..08e23f623 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,21 @@ -FROM node:16.6.1-alpine3.13 +FROM node:16-alpine -RUN apk add --no-cache python2 build-base - - -COPY --chown=node:node ./federator /app/federator -COPY --chown=node:node ./bridge/abi /app/bridge/abi - -WORKDIR /app/federator - -RUN chown -R node:node . +RUN apk add --no-cache build-base git python3 +WORKDIR /home/node USER node +COPY --chown=node:node ./federator/package*.json ./federator/ +WORKDIR ./federator RUN npm ci -ENTRYPOINT [ "npm", "start" ] \ No newline at end of file +WORKDIR ../ +COPY --chown=node:node ./bridge/abi ./bridge/abi/ +COPY --chown=node:node ./federator/ ./federator/ + +WORKDIR ./federator +RUN (cd ./config/ && cp config.sample.js config.js) && \ + npx tsc --build + +WORKDIR ./built/federator +CMD ["node", "./src/main.js"]