Skip to content

Commit

Permalink
version 1.5: update docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
pycook committed Nov 30, 2019
1 parent 882b158 commit 8ee7c6d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ ENV TZ=Asia/Shanghai
RUN pip install --no-cache-dir -r docs/requirements.txt \
&& cp ./api/settings.py.example ./api/settings.py \
&& sed -i "s#{user}:{password}@127.0.0.1:3306/{db}#cmdb:123456@mysql:3306/cmdb#g" api/settings.py \
&& sed -i "s/127.0.0.1/redis/g" api/settings.py
&& sed -i "s#redis://127.0.0.1#redis://redis#g" api/settings.py \
&& sed -i 's#CACHE_REDIS_HOST = "127.0.0.1"#CACHE_REDIS_HOST = "redis"#g' api/settings.py

CMD ["bash", "-c", "flask run"]

Expand Down
13 changes: 10 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ services:
- cmdb-search

cmdb-api:
image: registry.cn-qingdao.aliyuncs.com/pycook/cmdb-api:1.0
image: registry.cn-qingdao.aliyuncs.com/pycook/cmdb-api:1.5
# build:
# context: .
# target: cmdb-api
container_name: cmdb-api
environment:
TZ: Asia/Shanghai
Expand All @@ -63,7 +66,8 @@ services:
- -c
- |
sed -i "s#USE_ES = False#USE_ES = True#g" api/settings.py
sed -i "s#ES_HOST = '127.0.0.1'#ES_HOST = cmdb-search#g" api/settings.py
sed -i "s#ES_HOST = '127.0.0.1'#ES_HOST = 'cmdb-search'#g" api/settings.py
sleep 15
gunicorn --workers=3 autoapp:app -b 0.0.0.0:5000 -D
flask init-cache
celery worker -A celery_worker.celery -E -Q cmdb_async --concurrency=1
Expand All @@ -77,7 +81,10 @@ services:
- cmdb-api

cmdb-ui:
image: registry.cn-qingdao.aliyuncs.com/pycook/cmdb-ui:1.0
image: registry.cn-qingdao.aliyuncs.com/pycook/cmdb-ui:1.5
# build:
# context: .
# target: cmdb-ui
container_name: cmdb-ui
depends_on:
- cmdb-api
Expand Down
2 changes: 1 addition & 1 deletion ui/.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
NODE_ENV=production
VUE_APP_PREVIEW=false
VUE_APP_API_BASE_URL=http://127.0.0.1:5001/api
VUE_APP_API_BASE_URL=http://127.0.0.1:5000/api
4 changes: 2 additions & 2 deletions ui/src/views/cmdb/ci/modules/CiDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
<a-table
rowKey="ci_id"
size="middle"
:columns="firstCIColumns[child.id]"
:dataSource="firstCIs[child.name]"
:columns="firstCIColumns[parent.id]"
:dataSource="firstCIs[parent.name]"
:pagination="false"
:scroll="{x: '100%'}"
></a-table>
Expand Down

0 comments on commit 8ee7c6d

Please sign in to comment.