mirror of https://github.com/veops/cmdb.git
Remove package-lock.json and remove some compile warnings
This commit is contained in:
parent
aee66c075b
commit
46213dd758
|
@ -17,8 +17,8 @@ def init_cache():
|
||||||
cis = CI.get_by(to_dict=False)
|
cis = CI.get_by(to_dict=False)
|
||||||
for ci in cis:
|
for ci in cis:
|
||||||
m = api.lib.cmdb.ci.CIManager()
|
m = api.lib.cmdb.ci.CIManager()
|
||||||
ci = m.get_ci_by_id_from_db(ci.id, need_children=False, use_master=False)
|
ci_dict = m.get_ci_by_id_from_db(ci.id, need_children=False, use_master=False)
|
||||||
if rd.get([ci.id]):
|
if rd.get([ci.id]):
|
||||||
return
|
return
|
||||||
rd.delete(ci.id)
|
rd.delete(ci.id)
|
||||||
rd.add({ci.id: json.dumps(ci)})
|
rd.add({ci.id: json.dumps(ci_dict)})
|
||||||
|
|
|
@ -1,29 +1,6 @@
|
||||||
version: '3.4'
|
version: '3.4'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
cmdb-api:
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: api/Dockerfile
|
|
||||||
image: cmdb-api:0.1
|
|
||||||
container_name: cmdb-api
|
|
||||||
command:
|
|
||||||
- /bin/bash
|
|
||||||
- -c
|
|
||||||
- |
|
|
||||||
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
|
|
||||||
gunicorn --workers=3 autoapp:app -b 0.0.0.0:5000 -D
|
|
||||||
celery worker -A celery_worker.celery -E -Q cmdb_async --concurrency=1
|
|
||||||
depends_on:
|
|
||||||
- cmdb-db
|
|
||||||
- cmdb-cache
|
|
||||||
networks:
|
|
||||||
new:
|
|
||||||
aliases:
|
|
||||||
- cmdb-api
|
|
||||||
|
|
||||||
cmdb-db:
|
cmdb-db:
|
||||||
image: mysql:5.7
|
image: mysql:5.7
|
||||||
container_name: cmdb-db
|
container_name: cmdb-db
|
||||||
|
@ -49,6 +26,27 @@ services:
|
||||||
aliases:
|
aliases:
|
||||||
- redis
|
- redis
|
||||||
|
|
||||||
|
cmdb-api:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: api/Dockerfile
|
||||||
|
image: cmdb-api:0.1
|
||||||
|
container_name: cmdb-api
|
||||||
|
command:
|
||||||
|
- /bin/bash
|
||||||
|
- -c
|
||||||
|
- |
|
||||||
|
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
|
||||||
|
depends_on:
|
||||||
|
- cmdb-db
|
||||||
|
- cmdb-cache
|
||||||
|
networks:
|
||||||
|
new:
|
||||||
|
aliases:
|
||||||
|
- cmdb-api
|
||||||
|
|
||||||
cmdb-ui:
|
cmdb-ui:
|
||||||
build:
|
build:
|
||||||
context: ./ui
|
context: ./ui
|
||||||
|
@ -63,12 +61,10 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- ./docs/nginx.cmdb.conf.example:/etc/nginx/conf.d/nginx.cmdb.conf.example
|
- ./docs/nginx.cmdb.conf.example:/etc/nginx/conf.d/nginx.cmdb.conf.example
|
||||||
command:
|
command:
|
||||||
- /bin/bash
|
- /bin/sh
|
||||||
- -c
|
- -c
|
||||||
- |
|
- |
|
||||||
envsubst '$$CMDB_API_HOST $$NGINX_PORT' < /etc/nginx/conf.d/nginx.cmdb.conf.example > /etc/nginx/conf.d/cmdb.conf
|
envsubst '$$CMDB_API_HOST $$NGINX_PORT' < /etc/nginx/conf.d/nginx.cmdb.conf.example > /etc/nginx/conf.d/cmdb.conf
|
||||||
rm -f /etc/nginx/conf.d/default.conf
|
|
||||||
curl http://cmdb-api:5000/api/v0.1/ci/flush
|
|
||||||
nginx -g 'daemon off;'
|
nginx -g 'daemon off;'
|
||||||
networks:
|
networks:
|
||||||
- new
|
- new
|
||||||
|
|
Loading…
Reference in New Issue