From 174a0c09380213cc226466a9755fc8e8cbf8a6b3 Mon Sep 17 00:00:00 2001 From: isnoor Date: Tue, 10 Oct 2023 19:35:05 +0700 Subject: [PATCH 1/2] first commit docker compose for development --- .gitignore | 1 + dev/.env.example | 10 +++++++ dev/README.md | 63 +++++++++++++++++++++++++++++++++++++++++ dev/docker-compose.yaml | 26 +++++++++++++++++ 4 files changed, 100 insertions(+) create mode 100644 .gitignore create mode 100644 dev/.env.example create mode 100644 dev/README.md create mode 100644 dev/docker-compose.yaml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6dba1cc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +dev/.env \ No newline at end of file diff --git a/dev/.env.example b/dev/.env.example new file mode 100644 index 0000000..bb1e35f --- /dev/null +++ b/dev/.env.example @@ -0,0 +1,10 @@ +## for Asterisk only +AMI_HOST=155.138.131.82 +AMI_PORT=5038 +AMI_USER=ami +AMI_PASS=123 + +ARI_USERNAME=ariuser +ARI_PASSWORD=myaripassword + +LINEBLOCS_KEY=123 diff --git a/dev/README.md b/dev/README.md new file mode 100644 index 0000000..8d99a04 --- /dev/null +++ b/dev/README.md @@ -0,0 +1,63 @@ +# Use Docker Compose to develop lineblocs - asterisk + +## Structure of directory +```shell +. +. +├── configs +├── dev +| ├── docker-compose.yaml +| ├── .env +| └── README.md +├── Dockerfile +├── entrypoint.sh +└── irontec.list +``` + +## Simple running +```shell +$ git clone https://github.com/Lineblocs/asterisk.git +$ cd asterisk/dev +$ cp .env.example .env +$ docker compose up -d +``` + +## Advance running + +### Clone user-app project +Clone docker compose and move to directory. +```shell +$ git clone https://github.com/Lineblocs/asterisk.git +$ cd asterisk/dev +``` + +### Make .env file and confige +```shell +$ cp .env.example .env +``` +`AMI_HOST` +`AMI_PORT` +`AMI_USER` +`AMI_PASS` + +`ARI_USERNAME` +`ARI_PASSWORD` + +`LINEBLOCS_KEY` + + +### create container +Create and run container with this command below. + +```shell +$ docker compose up -d +``` + +### Useful command +Check node log `docker logs -f lineblocs-asterisk` + +Log in to terminal of container -> `docker exec -it lineblocs-asterisk bash` + +Modify asterisk project under `asterisk` directory + +After change configuration, Please run `docker compose restart` diff --git a/dev/docker-compose.yaml b/dev/docker-compose.yaml new file mode 100644 index 0000000..2f45211 --- /dev/null +++ b/dev/docker-compose.yaml @@ -0,0 +1,26 @@ +version: "3.6" +x-logging: &default-logging + options: + max-size: "100m" + max-file: "5" + driver: json-file +services: + asterisk: + build: + context: .. + dockerfile: Dockerfile + image: lineblocs-asterisk + volumes: + - ../configs:/etc/asterisk/ + logging: *default-logging + container_name: lineblocs-asterisk + restart: unless-stopped + environment: + - AMI_USER=${AMI_USER} + - AMI_PASS=${AMI_PASS} + - AMI_PORT=${AMI_PORT} + - AMI_HOST=${AMI_HOST} + - ARI_USERNAME=${ARI_USERNAME} + - ARI_PASSWORD=${ARI_PASSWORD} + - LINEBLOCS_KEY=${LINEBLOCS_KEY} + network_mode: "host" \ No newline at end of file From 7542a84606f7e7409ec188dce44bb6de1ed40ffd Mon Sep 17 00:00:00 2001 From: isnoor Date: Tue, 10 Oct 2023 19:47:02 +0700 Subject: [PATCH 2/2] change typo --- dev/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/README.md b/dev/README.md index 8d99a04..cb5f3c9 100644 --- a/dev/README.md +++ b/dev/README.md @@ -24,7 +24,7 @@ $ docker compose up -d ## Advance running -### Clone user-app project +### Clone asterisk project Clone docker compose and move to directory. ```shell $ git clone https://github.com/Lineblocs/asterisk.git