提交 54756d22 authored 作者: Jim White's avatar Jim White 提交者: GitHub

Merge pull request #2 from feclare/master

Run init_mongo.js every time the docker is started
......@@ -18,8 +18,13 @@
FROM mongo:latest
MAINTAINER Jim White <james_white2@dell.com>
ENV SLEEP_TIME_BEFORE_CONFIG=10
#copy initialization script for later initialization
COPY *.js /edgex/mongo/config/
COPY launch-edgex-mongo.sh /edgex/mongo/config/
#expose Mongodb's port
EXPOSE 27017
CMD /edgex/mongo/config/launch-edgex-mongo.sh
#!/bin/sh
# Copyright 2017 Cavium Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
set -e
mongod --smallfiles &
echo "Waiting for $SLEEP_TIME_BEFORE_CONFIG seconds before configuring mongo"
sleep $SLEEP_TIME_BEFORE_CONFIG
mongo /edgex/mongo/config/init_mongo.js
wait
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册