Commit c9929e66 by Hao Chen

add Docker build info to README

parent a621080f
...@@ -106,12 +106,58 @@ If you want to set your admin, you can change the file : /app/server/fixtures.js ...@@ -106,12 +106,58 @@ If you want to set your admin, you can change the file : /app/server/fixtures.js
详情参见 [egg.md](docs/egg.md) 详情参见 [egg.md](docs/egg.md)
# Docker build # Docker
docker build -t mcotton_v1 . ## 开机后启动服务:
docker start mymongo
docker start mcotton_v1
docker exec -it mcotton_v1 bash
> cd mcotton-v1
> ./start_mcotton.sh
## 环境重建
**本节内容用于mCotton系统毁坏后的创建,如非必要,请不要执行**
# Docker run ### 重建 Mongo Docker
docker pull mongo
docker stop mymongo
docker rm mymongo
docker run -d -p 27017:27017 --name mymongo -v $(cd ~ && pwd)/data/mongo:/data mongo docker run -d -p 27017:27017 --name mymongo -v $(cd ~ && pwd)/data/mongo:/data mongo
docker run -d -p 3000:3000 -p 1883:1883 --link mymongo:mongodb --name mcotton_v1 -v $(cd ~ && pwd)/data/mcotton_v1:/data -w /data mcotton_v1 ### 重新构建 mCotton Docker
\ No newline at end of file
cd ~/workshops/mcotton-v1
git clone https://git.microduino.cn/mCotton/mcotton-v1.git
git reset --hard HEAD
git pull
docker build -t mcotton_v1 .
### 运行 mcotton_v1 Docker
docker stop mcotton_v1
docker rm mcotton_v1
docker run -d -p 80:3000 -p 1883:1883 --link mymongo:mongodb --name mcotton_v1 -w /data mcotton_v1
docker exec -it mcotton_v1 bash
> cd mcotton-v1
> meteor npm install --save bcrypt
> ./start_mcotton.sh
### 推送 docker 到 hub.microduino.cn
docker login -u %user% -p %password% hub.microduino.cn
docker commit mcotton_v1 mcotton_v1
docker tag mcotton_v1 hub.microduino.cn/mcotton/mcotton_v1
docker push hub.microduino.cn/mcotton/mcotton_v1
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment