Stay Hungry,Stay Foolish!

dockerfile from as

dockerfile from as

https://juejin.cn/s/dockerfile%20from%20as

 

Demo

https://github.com/andreaskring/fastapi-keycloak-angular

分离构建镜像和运行镜像

FROM node:current-alpine as build

WORKDIR /app

COPY ./angular/package.json ./
COPY ./angular/package-lock.json ./
RUN npm install

COPY ./angular ./
RUN npm run build

FROM nginx

COPY ./angular/nginx.conf /etc/nginx/conf.d/angular.conf
COPY --from=build /app/dist/angular /usr/share/nginx/html

 

posted @ 2023-05-09 10:00  lightsong  阅读(114)  评论(0编辑  收藏  举报
Life Is Short, We Need Ship To Travel