Skip to content

Instantly share code, notes, and snippets.

@stephendarling
Created June 20, 2020 17:27
Show Gist options
  • Select an option

  • Save stephendarling/633dc750f1347b9fd5a5dc9a188b96d2 to your computer and use it in GitHub Desktop.

Select an option

Save stephendarling/633dc750f1347b9fd5a5dc9a188b96d2 to your computer and use it in GitHub Desktop.
Use multiple images in Dockerfile
# Create first image as Builder
FROM node:12.16.1-alpine As builder
WORKDIR /usr/src/app
COPY package.json package-lock.json ./
RUN npm install
COPY . .
RUN npm run build --prod
FROM nginx:1.15.8-alpine
# Copy files from the first image using the builder reference
COPY --from=builder /usr/src/app/dist/app-test/ /usr/share/nginx/html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment