Improve dockerfile and update packages with security vulns (#32)
* add package-lock for reproducable builds * update vulnerable packages and engine * improve dockerfile and allow to build different grunt targetsmaster
parent
be5b8668bd
commit
db740f832b
@ -1 +1,6 @@ |
|||||||
**/.git |
.git |
||||||
|
.gitignore |
||||||
|
.dockerignore |
||||||
|
node_modules |
||||||
|
npm-debug.log |
||||||
|
Dockerfile |
||||||
|
@ -1,10 +1,15 @@ |
|||||||
FROM node |
FROM node:lts-alpine AS builder |
||||||
|
ARG GRUNT_TASK=default |
||||||
RUN git clone https://github.com/goerli/netstats-server /netstats-server |
WORKDIR /ethstats-server |
||||||
WORKDIR /netstats-server |
COPY ["package.json", "package-lock.json*", "./"] |
||||||
RUN npm install |
RUN npm ci --only=production && npm install -g grunt-cli |
||||||
RUN npm install -g grunt-cli |
COPY --chown=node:node . . |
||||||
RUN grunt |
RUN grunt $GRUNT_TASK |
||||||
|
|
||||||
|
FROM node:lts-alpine |
||||||
|
RUN apk add dumb-init |
||||||
|
WORKDIR /ethstats-server |
||||||
|
COPY --chown=node:node --from=builder /ethstats-server . |
||||||
|
USER node |
||||||
EXPOSE 3000 |
EXPOSE 3000 |
||||||
CMD ["npm", "start"] |
CMD ["dumb-init", "node", "./bin/www"] |
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue