2018-05-05 13:12:56 +02:00
|
|
|
# Do the npm install or yarn install in the full image
|
|
|
|
FROM mhart/alpine-node AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package.json .
|
|
|
|
RUN yarn install
|
|
|
|
COPY . .
|
2018-10-19 00:36:04 +02:00
|
|
|
RUN yarn build && yarn --production
|
2018-05-05 13:12:56 +02:00
|
|
|
|
|
|
|
# And then copy over node_modules, etc from that stage to the smaller base image
|
|
|
|
FROM mhart/alpine-node:base
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=builder /app .
|
|
|
|
EXPOSE 3000
|
|
|
|
CMD ["node_modules/.bin/next", "start"]
|