Skip to content

Commit cbc0ded

Browse files
committed
[ADD] docker
[ADD] readme
1 parent 35fed13 commit cbc0ded

2 files changed

Lines changed: 25 additions & 3 deletions

File tree

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ Source code [Github](https://github.com/shurshilov/odoo)
99

1010

1111
## What is this program for??
12-
Create web server on the same server as asterix.
12+
Create web server on the same server as asterisk.
1313
This server can:
1414
1. Provide asterisk calls history by http endpoint like start_datetime and end_datetime (mysql,postgresql,sqlite,csv)
1515
2. Provide webhooks for asterisk. Allows you to send request to your site, for example, an incoming call that was answered or a missed call. Next, your server saves this to the database and notifies clients (browsers) through any mechanism (websockets, longpolling) that a call has arrived and, for example, by calling a pop-up window and creating a lead or opening a partner's card
16-
3. Also provide recordngs although they are available in asterix ari, just to address the same address. (essentially a duplication)
16+
3. Also provide recordngs although they are available in asterisk ari, just to address the same address. (essentially a duplication)
1717
4. Endpoint numbers list
1818
4. Endpoint checkup ( getting the status of the service)
19+
After launching the service, the documentation with the available endpoints will be at your_ir:8082/docs
20+
Simple http base authentication is also enabled, the username and password are taken from the config to protect your data in asterisk.
1921

2022
## How configure Asterisk?
2123

@@ -67,7 +69,7 @@ or
6769
python3 -m uvicorn main:app --host 127.0.0.1 --port 8082 --log-level debug --workers 2
6870
```
6971

70-
### 2 Variant. Start on docker.
72+
### 2 Variant. Start on docker.(no tested)
7173

7274
On your asterist server. Setup docker enviroment.
7375

docker/Dockerfile_backend.prod

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# установка базового образа (host OS)
2+
FROM registry.kdp/kdp/python:3.11.4
3+
4+
ENV WORKDIR=/usr/src/app
5+
6+
# Не позволяет Python записывать файлы pyc на диск (эквивалентно опции python -B)
7+
# Запрещает Python буферизовать stdout и stderr (эквивалентно опции python -u)
8+
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1
9+
10+
# установка рабочей директории в контейнере
11+
WORKDIR $WORKDIR
12+
13+
# копирование файла зависимостей в рабочую директорию
14+
COPY ./ ./backend
15+
COPY requirements.txt .
16+
17+
# установка зависимостей
18+
RUN pip install --no-cache-dir -r requirements.txt
19+
20+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8082", "--log-level", "debug", "--loop", "uvloop", "--http", "httptools", "--workers", "2"]

0 commit comments

Comments
 (0)