tidyups for image building chapter

This commit is contained in:
BillMills
2019-06-19 11:22:15 -04:00
parent 7b8510945e
commit 4c04d52c3c
6 changed files with 4 additions and 112 deletions

View File

@@ -1,10 +1,5 @@
FROM node:6.11.5
FROM node
WORKDIR /usr/src/app
COPY package.json .
COPY . .
RUN npm install
EXPOSE 8080
CMD [ "npm", "start" ]
COPY . .

View File

@@ -1,15 +0,0 @@
FROM node AS builder
WORKDIR /src
COPY package.json .
RUN npm install
# app image
FROM node
EXPOSE 8080
CMD npm start
WORKDIR /app
COPY --from=builder /src/node_modules/ /app/node_modules/
COPY . .

View File

@@ -1,15 +0,0 @@
FROM node AS builder
WORKDIR /src
COPY package.json .
RUN npm install
# app image
FROM node:alpine
EXPOSE 8080
CMD npm start
WORKDIR /app
COPY --from=builder /src/node_modules/ /app/node_modules/
COPY . .

View File

@@ -1,19 +0,0 @@
FROM node:10.15-stretch AS builder
WORKDIR /src
COPY package.json .
RUN npm install
# app image
FROM node:10.15.3-alpine
EXPOSE 8080
CMD [ "node", "server.js" ]
USER node
HEALTHCHECK --interval=5s --timeout=10s --start-period=15s \
CMD [ "node", "healthcheck.js" ]
WORKDIR /app
COPY --from=builder /src/node_modules/ /app/node_modules/
COPY . .