mirror of https://github.com/veops/cmdb.git
修复nginx转发问题
This commit is contained in:
parent
5f389459e8
commit
47767e22d8
|
@ -1,16 +0,0 @@
|
|||
FROM centos:7.6.1810
|
||||
|
||||
LABEL description="Python2.7.5,cmdb"
|
||||
|
||||
RUN mkdir -p /data/apps/cmdb /data/apps/cmdb/logs
|
||||
|
||||
COPY . /data/apps/cmdb
|
||||
|
||||
WORKDIR /data/apps/cmdb
|
||||
|
||||
RUN yum install -y epel-release \
|
||||
&& yum install -y python-pip \
|
||||
&& pip install --no-cache-dir -r docker-start/requirements.txt
|
||||
|
||||
CMD ["bash", "-c", "cp api/settings.py.example api/settings.py && sed -i 's#{user}:{password}@127.0.0.1:3306/{db}#:@127.0.0.1:3306/cmdb#g' api/settings.py && flask run"]
|
||||
|
|
@ -1,17 +1,18 @@
|
|||
FROM centos:7.6.1810
|
||||
# build under cmdb directory other than api
|
||||
# maybe use: cd ..
|
||||
FROM centos:7.6.1810 AS cmdb-api
|
||||
|
||||
LABEL description="Python2.7.5,cmdb"
|
||||
|
||||
RUN mkdir -p /data/apps/cmdb ~/.pip /data/apps/cmdb/logs
|
||||
RUN mkdir -p /data/apps/cmdb /data/apps/cmdb/logs
|
||||
|
||||
COPY .. /data/apps/cmdb
|
||||
COPY . /data/apps/cmdb
|
||||
|
||||
WORKDIR /data/apps/cmdb
|
||||
|
||||
RUN mv /data/apps/cmdb/pip.conf ~/.pip/ \
|
||||
&& yum install -y epel-release \
|
||||
RUN yum install -y epel-release \
|
||||
&& yum install -y python-pip \
|
||||
&& pip install -r requirements.txt
|
||||
&& pip install --no-cache-dir -r docker-start/requirements.txt
|
||||
|
||||
CMD ["bash", "-c", "cp api/settings.py.example api/settings.py && sed -i 's#{user}:{password}@127.0.0.1:3306/{db}#:@127.0.0.1:3306/cmdb#g' api/settings.py && flask run"]
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ services:
|
|||
cmdb-ui:
|
||||
build:
|
||||
context: ./ui
|
||||
dockerfile: Dockerfile-ui
|
||||
dockerfile: Dockerfile
|
||||
image: cmdb-ui:0.1
|
||||
container_name: cmdb-ui
|
||||
command: ["sh", "-c", "sed -i 's#http://127.0.0.1:5000##g' .env && yarn run serve"]
|
||||
|
@ -16,15 +16,13 @@ services:
|
|||
start_period: 10s
|
||||
depends_on:
|
||||
- cmdb-api
|
||||
ports:
|
||||
- "8000:8000"
|
||||
networks:
|
||||
- new
|
||||
|
||||
cmdb-api:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile-api
|
||||
context: .
|
||||
dockerfile: api/Dockerfile
|
||||
image: cmdb-api:0.1
|
||||
container_name: cmdb-api
|
||||
command:
|
||||
|
@ -34,7 +32,9 @@ services:
|
|||
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
|
||||
gunicorn --workers=3 autoapp:app -b 0.0.0.0:5000 -D
|
||||
sleep 5
|
||||
celery worker -A celery_worker.celery -E -Q cmdb_async --concurrency=1
|
||||
depends_on:
|
||||
- cmdb-db
|
||||
- cmdb-cache
|
||||
|
@ -87,7 +87,9 @@ services:
|
|||
- -c
|
||||
- |
|
||||
envsubst '$$CMDB_API_HOST $$CMDB_UI_HOST $$NGINX_PORT' < /etc/nginx/conf.d/nginx.cmdb.conf.example > /etc/nginx/conf.d/cmdb.conf
|
||||
rm /etc/nginx/conf.d/default.conf
|
||||
nginx -g 'daemon off;'
|
||||
curl http://localhost/api/v0.1/ci/flush
|
||||
networks:
|
||||
- new
|
||||
ports:
|
||||
|
|
Loading…
Reference in New Issue