-
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.
- Loading branch information
1 parent
292b3a6
commit 2bfe54a
Showing
7 changed files
with
112 additions
and
27 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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
#设置构建的基础镜像 | ||
FROM node:16.15.0 | ||
# 设置工作目录 | ||
RUN mkdir -p /project/ | ||
WORKDIR /project/ | ||
COPY package*.json /project/ | ||
#设置npm下载依赖来源为淘宝源 | ||
RUN npm install -g cnpm --registry=https://registry.npm.taobao.org | ||
RUN rm -rf node_modules && cd /project | ||
#安装项目依赖 | ||
RUN npm install | ||
RUN cnpm install | ||
COPY . /project/ | ||
#在启动镜像时执行启动项目的命令 | ||
CMD npm run dev | ||
EXPOSE 8000 |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
version: '3' # compose编排版本为3 | ||
services: | ||
# 服务 | ||
antdpro-demo: | ||
# 服务名称 | ||
hostname: antdpro-demo # 容器主机名 | ||
build: | ||
# 创建容器过程 | ||
context: ./ # 所需素材都在该目录(仓库)下 | ||
dockerfile: Dockerfile # 指定Dockerfile文件 | ||
ports: | ||
# 提供端口 | ||
- 8000:8000 # 对外提供(暴露)的端口 | ||
networks: | ||
# 指定网络 | ||
- dockerbetweennetwork | ||
# volumes: | ||
# # 数据卷 | ||
# - ./ # 将宿主机该仓库内文件与nginx首页文件相关联(容器) | ||
networks: | ||
# 对外公开需要声明networks群集名称 | ||
test: |
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
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
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
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
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