docker images use aliyun

This commit is contained in:
pycook 2019-11-13 11:56:17 +08:00
parent 39153e92d1
commit c0c6d116b5
3 changed files with 25 additions and 25 deletions

View File

@ -1,5 +1,5 @@
# ================================= UI ================================ # ================================= UI ================================
FROM exiasr/alpine-yarn-nginx AS cmdb-ui FROM node:alpine AS builder
LABEL description="cmdb-ui" LABEL description="cmdb-ui"
@ -7,8 +7,14 @@ COPY ui /data/apps/cmdb-ui
WORKDIR /data/apps/cmdb-ui WORKDIR /data/apps/cmdb-ui
RUN sed -i "s#http://127.0.0.1:5000##g" .env && yarn install && yarn build \ RUN sed -i "s#http://127.0.0.1:5000##g" .env && yarn install && yarn build
&& mkdir /etc/nginx/html && cp -r dist/* /etc/nginx/html && rm -f /etc/nginx/conf.d/default.conf
FROM nginx:alpine AS cmdb-ui
RUN mkdir /etc/nginx/html && rm -f /etc/nginx/conf.d/default.conf
COPY --from=builder /data/apps/cmdb-ui/dist /etc/nginx/html/
# ================================= API ================================ # ================================= API ================================

View File

@ -23,12 +23,22 @@ Overview
![模型配置](https://raw.githubusercontent.com/pycook/cmdb/master/ui/public/cmdb02.jpeg) ![模型配置](https://raw.githubusercontent.com/pycook/cmdb/master/ui/public/cmdb02.jpeg)
环境和依赖
Docker一键快速构建
----
- 进入主目录先安装docker环境
```
docker-compose up -d
```
- 浏览器打开: [http://localhost:8000](http://localhost:8000)
本地搭建: 环境和依赖
---- ----
- 存储: mysql, redis - 存储: mysql, redis
- python版本: python2.7, >=python3.6 - python版本: python2.7, >=python3.6
Install Install
---- ----
- 启动mysql服务, redis服务 - 启动mysql服务, redis服务
@ -76,13 +86,3 @@ cp api/settings.py.example api/settings.py
- 启动API: ```make api``` - 启动API: ```make api```
- 启动UI: ```make ui``` - 启动UI: ```make ui```
- 启动worker: ```make worker``` - 启动worker: ```make worker```
Install by Docker
----
- 进入主目录首次镜像的构建需要**10分钟**左右视网络情况而定
```
docker-compose up -d
```
- 浏览器打开: [http://localhost:8000](http://localhost:8000)

View File

@ -2,7 +2,7 @@ version: '3.5'
services: services:
cmdb-db: cmdb-db:
image: mysql:5.7 image: registry.cn-qingdao.aliyuncs.com/pycook/cmdb-db:1.0
container_name: cmdb-db container_name: cmdb-db
environment: environment:
TZ: Asia/Shanghai TZ: Asia/Shanghai
@ -19,7 +19,7 @@ services:
- mysql - mysql
cmdb-cache: cmdb-cache:
image: redis:latest image: registry.cn-qingdao.aliyuncs.com/pycook/cmdb-cache:1.0
container_name: cmdb-cache container_name: cmdb-cache
networks: networks:
new: new:
@ -27,10 +27,7 @@ services:
- redis - redis
cmdb-api: cmdb-api:
build: image: registry.cn-qingdao.aliyuncs.com/pycook/cmdb-api:1.0
context: .
target: cmdb-api
image: cmdb-api:0.1
container_name: cmdb-api container_name: cmdb-api
environment: environment:
TZ: Asia/Shanghai TZ: Asia/Shanghai
@ -50,10 +47,7 @@ services:
- cmdb-api - cmdb-api
cmdb-ui: cmdb-ui:
build: image: registry.cn-qingdao.aliyuncs.com/pycook/cmdb-ui:1.0
context: .
target: cmdb-ui
image: cmdb-ui:0.1
container_name: cmdb-ui container_name: cmdb-ui
depends_on: depends_on:
- cmdb-api - cmdb-api