Horje
A multi-stage Dockerfile for building nodejs Code Example
A multi-stage Dockerfile for building nodejs
# 
# Build stage 1.
# This state builds our TypeScript and produces an intermediate Docker image containing the compiled JavaScript code.
#
FROM node:10.15.2

WORKDIR /usr/src/app
COPY package*.json ./
COPY tsconfig.json ./
RUN npm install
COPY ./src ./src
RUN npm run build

#
# Build stage 2.
# This stage pulls the compiled JavaScript code from the stage 1 intermediate image.
# This stage builds the final Docker image that we'll use in production.
#
FROM node:10.15.2

WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install --only=production
COPY --from=0 /usr/src/app/build ./build
EXPOSE 80
CMD npm start
Source: morioh.com




Shell

Related
bash quotes Code Example bash quotes Code Example
tinker lost color cli Code Example tinker lost color cli Code Example
open local files wsl Code Example open local files wsl Code Example
yarn upgrade typescript Code Example yarn upgrade typescript Code Example
linux how to undeo ctrl+z Code Example linux how to undeo ctrl+z Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11