每次都要想 Dockerfile 怎麼寫,乾脆筆記起來. build static website & run with nginx
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| FROM node:lts-alpine as builder
ENV NPM_CONFIG_LOGLEVEL=warn ENV NPM_CONFIG_COLOR=false
WORKDIR /app COPY . /app
RUN npm install
RUN npm run build
FROM nginx:stable-alpine as deploy COPY --from=builder /app/build /usr/share/nginx/html
|