From 217b9aa474e13bd93d6415c1acf72ae25ab01e1d Mon Sep 17 00:00:00 2001 From: uscwifi <42139780+uscwifi@users.noreply.github.com> Date: Mon, 10 May 2021 13:55:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81docker=E9=83=A8=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 1、docker build -t tetris:latest . - 2、docker run -d --name tetris -p 8090:80 tetris:latest --- Dockerfile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..3b40dba3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM node:lts-alpine AS build0 + +COPY . /tetris/ + +WORKDIR /tetris + +RUN npm config set registry https://repo.huaweicloud.com/repository/npm/ && \ + npm cache clean -f && \ + npm install && \ + npm run build + + +FROM nginx:alpine + +COPY --from=build0 /tetris/docs /usr/share/nginx/html