improve Docker layer caching
This commit is contained in:
parent
509504c7c8
commit
2eb74c000b
1 changed files with 11 additions and 7 deletions
18
Dockerfile
18
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"]
|
||||
|
|
Loading…
Reference in a new issue