docker images use aliyun

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

View File

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

View File

@ -23,12 +23,22 @@ Overview
![模型配置](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
- python版本: python2.7, >=python3.6
Install
----
- 启动mysql服务, redis服务
@ -76,13 +86,3 @@ cp api/settings.py.example api/settings.py
- 启动API: ```make api```
- 启动UI: ```make ui```
- 启动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:
cmdb-db:
image: mysql:5.7
image: registry.cn-qingdao.aliyuncs.com/pycook/cmdb-db:1.0
container_name: cmdb-db
environment:
TZ: Asia/Shanghai
@ -19,7 +19,7 @@ services:
- mysql
cmdb-cache:
image: redis:latest
image: registry.cn-qingdao.aliyuncs.com/pycook/cmdb-cache:1.0
container_name: cmdb-cache
networks:
new:
@ -27,10 +27,7 @@ services:
- redis
cmdb-api:
build:
context: .
target: cmdb-api
image: cmdb-api:0.1
image: registry.cn-qingdao.aliyuncs.com/pycook/cmdb-api:1.0
container_name: cmdb-api
environment:
TZ: Asia/Shanghai
@ -50,10 +47,7 @@ services:
- cmdb-api
cmdb-ui:
build:
context: .
target: cmdb-ui
image: cmdb-ui:0.1
image: registry.cn-qingdao.aliyuncs.com/pycook/cmdb-ui:1.0
container_name: cmdb-ui
depends_on:
- cmdb-api