-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #196 from terwer/v4.x
feat:Fix docker build
- Loading branch information
Showing
2 changed files
with
23 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,3 +88,4 @@ yarn.lock | |
node_modules | ||
node_modules_dev/ | ||
node_modules_prod/ | ||
node_modules/.yargit n-integrity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,37 @@ | ||
#依赖的镜像 | ||
FROM node:10.15.3-alpine | ||
FROM node:16.17-alpine | ||
|
||
# 工作目录 | ||
WORKDIR /app | ||
|
||
# 安装依赖 | ||
COPY ./jvue-front/package.json ./ | ||
|
||
# yarn 已经有了,没必要重复安装 | ||
# 因为被墙,单独安装 | ||
ENV SASS_BINARY_SITE https://npm.taobao.org/mirrors/node-sass | ||
# ENV SASS_BINARY_SITE https://cdn.npmmirror.com/binaries/node-sass | ||
# CDN注册以及安装依赖库 | ||
RUN npm config set registry https://registry.npm.taobao.org && \ | ||
npm set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver && \ | ||
npm cache clean --force && \ | ||
npm install --save-dev node-sass sass-loader && \ | ||
npm install | ||
# RUN npm config set registry https://registry.npmmirror.com/ && \ | ||
# npm i -g yarn | ||
|
||
RUN yarn config set registry https://registry.npmmirror.com/ --global && \ | ||
yarn config set disturl https://npmmirror.com/package/dist --global && \ | ||
yarn config set sass_binary_site https://cdn.npmmirror.com/binaries/node-sass --global && \ | ||
yarn config set electron_mirror https://registry.npmmirror.com/binary.html?path=electron/ --global && \ | ||
yarn config set puppeteer_download_host https://registry.npmmirror.com/binary.html --global && \ | ||
yarn config set chromedriver_cdnurl https://cdn.npmmirror.com/binaries/chromedriver --global && \ | ||
yarn config set operadriver_cdnurl https://cdn.npmmirror.com/binaries/operadriver --global && \ | ||
yarn config set phantomjs_cdnurl https://cdn.npmmirror.com/binaries/phantomjs --global && \ | ||
yarn config set selenium_cdnurl https://cdn.npmmirror.com/binaries/selenium --global && \ | ||
yarn config set node_inspector_cdnurl https://cdn.npmmirror.com/binaries/node-inspector --global | ||
|
||
RUN yarn | ||
|
||
RUN yarn build | ||
|
||
COPY ./jvue-front . | ||
|
||
# 注意这个一定要要在npm install后面,否则devDependencies的包无法安装 | ||
# 注意这个一定要要在yarn后面,否则devDependencies的包无法安装 | ||
ENV HOST 0.0.0.0 | ||
|
||
CMD ["npm", "run", "start"] | ||
CMD ["yarn", "start"] |
1f35191
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
jvue – ./
jvue4.vercel.app
jvue-git-master-terwergreen.vercel.app
jvue-terwergreen.vercel.app
terwer.space
www.terwer.space