diff --git a/Dockerfile b/Dockerfile index d55be7b..75b31c2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,22 @@ -FROM node:alpine - +FROM node:alpine as builder WORKDIR /app -ADD . /app -RUN apk add --update git bash && \ - npm install --production && \ - apk del git && \ - rm -rf /tmp/* /var/cache/apk/* +RUN apk add --update git bash + +ADD package.json /app +RUN npm install --production + +FROM node:alpine +WORKDIR /app EXPOSE 3000 ENV HOSTNAME v5.db.transport.rest ENV PORT 3000 +COPY --from=builder /app/node_modules ./node_modules +ADD . /app + RUN npm run build CMD ["node", "index.js"]