Sign inSign up

andrius/alpine-adhearsion

By andrius

Updated about 7 years ago

Adhearsion on Docker

Image
1

1.9K

andrius/alpine-adhearsion repository overview

Adhearsion on Docker

The smallest Docker image with Adhearsion.

Total size of this image is only:

This image is based on Alpine Linux image, which is only a 5MB image.

What's included

Adhearsion 3.0.0rc1-onbuild (relese candidate) and 2.6.x-onbuild (stable)

There is project generated with ahn create command, and it is located in /ahn folder. config.ru file renamed to remove sinatra dependency and start adhearsion (only in 3.0.0rc1).

Usage

It can't be used separate. Easiest way to proceed is to copy content of /ahn folder from running docker container and modyfy based on your needs:

Run docker:

docker run -ti --rm --name ahn \
  andrius/alpine-adhearsion:3.0.0rc1-onbuild \
  sh -c "while :; do echo 'Hit CTRL+C'; sleep 3; done"

Copy ahn folder (do it in another terminal tab):

docker cp ahn:/ahn .

Modify Gemfile to add your gems and dependences, edit config files in ahn folder etc;

Create .env file within copied ahn folder, that hold credentials for Asterisk PBX or Freeswitch:

ASTERISK_MANAGER_USERNAME=adhearsion
ASTERISK_MANAGER_PASSWORD=somepassword
ASTERISK_PORT=5038
ASTERISK_HOST=asterisk

Create Dockerfile:

# vim:set ft=dockerfile:
FROM andrius/alpine-adhearsion:3.0.0rc1-onbuild

MAINTAINER Andrius Kairiukstis <[email protected]>

RUN apk add --update tzdata \
&&  cp -R /usr/share/zoneinfo/Europe/London /etc/localtime \
&&  echo 'Europe/London' >  /etc/timezone \
&&  apk del tzdata \
&&  rm -rf /var/cache/apk/*

Create docker-compose.yml file with following content:

version: '2'

services:
  ahn:
    build: .
    env_file: .env
    ports:
      - 0.0.0.0:8080:8080 # API server
    volumes:
      - "./:/ahn"

And start it (note, asterisk must be started before):

docker-compose up -d ahn

Now it is up and running, unless your asterisk of freeswitch credentials are wrong.

To generate new adhearsion controller, execute:

docker-compose run --rm ahn bundle exec ahn generate controller NAME

Tag summary

Content type

Image

Digest

Size

232.8 MB

Last updated

about 7 years ago

docker pull andrius/alpine-adhearsion:debian-2.6.3