0
Dockerfile配置与部署
source link: https://crazyyanchao.github.io/blog/2021/12/13/Dockerfile%E9%85%8D%E7%BD%AE%E4%B8%8E%E9%83%A8%E7%BD%B2.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Dockerfile配置与部署
- Yc-Ma
- Dec 13, 2021
Here’s the table of contents:
Dockerfile配置与部署
- 安装docker命令
yum install docker
- 打包docker镜像
sudo docker build -t ongdb-graphene:v-0.0.1 .
- 启动docker镜像【本地】
sudo docker run -p 8080:8080 ongdb-graphene:v-0.0.1
- 编辑Dockerfile文件
vim Dockerfile
FROM centos USER root WORKDIR /app ADD . /app RUN yum install -y npm maven RUN npm install -g cnpm -registry=https://registry.npm.taobao.org RUN npm install [email protected] [email protected] [email protected] -g RUN cnpm install [email protected] \ [email protected] \ [email protected] \ [email protected] \ [email protected] \ [email protected] \ [email protected] \ [email protected] \ [email protected] \ [email protected] \ [email protected] \ [email protected] \ [email protected] \ [email protected] [email protected] WORKDIR /app/browser #CMD ["cnpm","install"] #ENTRYPOINT ["cnpm", "start"]
- 启动docker镜像【本地】
sudo docker run -p 8080:8080 ongdb-graphene:v-0.0.1 bash -c "cnpm install && cnpm start"
- 查看docker容器中启动的进程
sudo docker ps
- 访问服务
http://ip:8080/app/
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK