better Dockerfile

This commit is contained in:
Radu Ioan Fericean
2015-05-09 11:33:33 +03:00
parent 21c1dfcd79
commit de12564377
5 changed files with 13 additions and 4 deletions

1
.gitignore vendored
View File

@@ -12,3 +12,4 @@ bin
dean*
data/vagrant/.vagrant
data/vagrant/vagrant_ansible_inventory_default
data/tutorials/fs_evsock/freeswitch/etc/freeswitch/

View File

@@ -11,7 +11,7 @@ RUN gpg --keyserver pool.sks-keyservers.net --recv-key D76EDC7725E010CF && gpg -
RUN echo 'deb http://files.freeswitch.org/repo/deb/debian/ jessie main' > /etc/apt/sources.list.d/freeswitch.list
# install dependencies
RUN apt-get -y update && apt-get -y install git bzr mercurial redis-server mysql-server python-pycurl python-mysqldb postgresql postgresql-client sudo wget freeswitch-meta-vanilla
RUN apt-get -y update && apt-get -y install git bzr mercurial redis-server mysql-server python-pycurl python-mysqldb postgresql postgresql-client sudo wget freeswitch-meta-vanilla vim zsh
# add cgrates user
RUN useradd -c CGRateS -d /var/run/cgrates -s /bin/false -r cgrates
@@ -19,6 +19,9 @@ RUN useradd -c CGRateS -d /var/run/cgrates -s /bin/false -r cgrates
# install golang
RUN wget -qO- https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz | tar xzf - -C /root/
#install oh-my-zsh
RUN wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O - | zsh
# cleanup
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

View File

@@ -6,6 +6,6 @@ From the project root:
``` bash
# build the image
docker build -t cgrates data/docker/devel
# create the container
docker run --rm -itv `pwd`:/root/code/src/github.com/cgrates/cgrates --name cgr cgrates
# create the container from the cgrates project roor
./data/docker/devel/run.sh
```

3
data/docker/devel/run.sh Executable file
View File

@@ -0,0 +1,3 @@
#/usr/bin/env sh
docker run --rm -p 3306:3306 -p 6379:6379 -p 2012:2012 -itv `pwd`:/root/code/src/github.com/cgrates/cgrates --name cgr cgrates

View File

@@ -2,6 +2,8 @@ export GOROOT=/root/go
export GOPATH=/root/code
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
sed -i 's/127.0.0.1/0.0.0.0/g' /etc/redis/redis.conf /etc/mysql/my.cnf /etc/postgresql/9.4/main/pg_hba.conf
/etc/init.d/mysql start
/etc/init.d/postgresql start
/etc/init.d/redis-server start
@@ -25,4 +27,4 @@ ln -s /root/code/bin/cgr-engine /usr/bin/cgr-engine
cd /usr/share/cgrates/tutorials/fs_evsock/freeswitch/etc/ && tar xzf freeswitch_conf.tar.gz
cd /root/cgr
bash --rcfile /root/.bashrc
zsh