ospis docker better start.sh

This commit is contained in:
Radu Ioan Fericean
2016-08-04 16:56:34 +03:00
parent a65e20109c
commit 3936bd8d09
3 changed files with 19 additions and 16 deletions

View File

@@ -35,7 +35,6 @@ cd /root/cgr
ln -s /root/code/bin/cgr-engine /usr/bin/
ln -s /root/code/bin/cgr-loader /usr/bin/
# expand freeswitch conf
cd /usr/share/cgrates/tutorials/fs_evsock/freeswitch/etc/ && tar xzf freeswitch_conf.tar.gz

View File

@@ -25,30 +25,25 @@ RUN chsh -s /usr/bin/zsh
# cleanup
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# create a link to data dir
RUN ln -s /root/code/src/github.com/cgrates/cgrates/data /usr/share/cgrates
# get cgrates from github
RUN mkdir -p /root/code/src/github.com/cgrates; cd /root/code/src/github.com/cgrates; git clone https://github.com/cgrates/cgrates.git
# create link to cgrates dir
RUN ln -s /root/code/src/github.com/cgrates/cgrates /root/cgr
# setup mysql for CGRateS
RUN cd /usr/share/cgrates/storage/mysql && ./setup_cgr_db.sh root CGRateS.org
# get deps
RUN cd /root/cgr; GOROOT=/root/go GOPATH=/root/code PATH=$GOROOT/bin:$GOPATH/bin:$PATH glide install
# build cgrates
RUN cd /root/cgr; GOROOT=/root/go GOPATH=/root/code PATH=$GOROOT/bin:$GOPATH/bin:$PATH ./build.sh
#env vars
RUN export GOROOT=/root/go; export GOPATH=/root/code; export PATH=$GOROOT/bin:$GOPATH/bin:$PATH
# build and install cgrates
RUN cd /root/cgr
RUN glide install
# create cgr-engine and cgr-loader link
# create links
RUN ln -s /root/code/bin/cgr-engine /usr/bin/
RUN ln -s /root/code/bin/cgr-loader /usr/bin/
RUN ln -s /root/code/src/github.com/cgrates/cgrates/data /usr/share/cgrates
RUN cd /root/cgr
# prepare zshrc
RUN echo 'export GOROOT=/root/go; export GOPATH=/root/code; export PATH=$GOROOT/bin:$GOPATH/bin:$PATH'>>/root/.zshrc
# set start command
RUN CMD /root/code/src/github.com/cgrates/cgrates/data/docker/osips_training/start.sh
CMD /root/code/src/github.com/cgrates/cgrates/data/docker/osips_training/start.sh

View File

@@ -1,8 +1,17 @@
# edit servers config files
sed -i 's/127.0.0.1/0.0.0.0/g' /etc/redis/redis.conf /etc/mysql/my.cnf
# start services
/etc/init.d/rsyslog start
/etc/init.d/mysql start
/etc/init.d/redis-server start
cgr-engine -config_dir=/root/cgr/data/conf/samples/osips_training
# setup mysql
cd /usr/share/cgrates/storage/mysql && ./setup_cgr_db.sh root CGRateS.org
# load tariff plan data
cd /root/cgr/data/tariffplans/osips_training; cgr-loader
cd /root/cgr
DISABLE_AUTO_UPDATE="true" zsh