mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 10:06:24 +05:00
better Dockerfile
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -12,3 +12,4 @@ bin
|
||||
dean*
|
||||
data/vagrant/.vagrant
|
||||
data/vagrant/vagrant_ansible_inventory_default
|
||||
data/tutorials/fs_evsock/freeswitch/etc/freeswitch/
|
||||
|
||||
@@ -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/*
|
||||
|
||||
|
||||
@@ -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
3
data/docker/devel/run.sh
Executable 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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user