-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #344 from lucasvuotto/fix/docker-build
Rework Dockerfile
- Loading branch information
Showing
1 changed file
with
15 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" ] | ||
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"] |