-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
35 lines (28 loc) · 1.19 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM python:3.9-slim-bullseye AS compile-image
LABEL maintainer="Wazo Maintainers <[email protected]>"
RUN python3 -m venv /opt/venv
# Activate virtual env
ENV PATH="/opt/venv/bin:$PATH"
COPY requirements.txt /usr/local/src/wazo-agid/requirements.txt
WORKDIR /usr/local/src/wazo-agid
RUN pip3 install -r requirements.txt
COPY setup.py /usr/local/src/wazo-agid/
COPY bin /usr/local/src/wazo-agid/bin
COPY wazo_agid /usr/local/src/wazo-agid/wazo_agid
RUN python3 setup.py install
FROM python:3.9-slim-bullseye AS build-image
COPY --from=compile-image /opt/venv /opt/venv
COPY ./etc/wazo-agid /etc/wazo-agid
RUN true\
&& adduser --disabled-password --gecos '' asterisk \
&& adduser --quiet --system --group --home /var/lib/wazo-agid wazo-agid \
&& mkdir -p /etc/wazo-agid/conf.d \
&& mkdir -p /etc/xivo \
&& install -D -o root -g root /dev/null /var/log/wazo-agid.log \
&& install -D -o root -g root /dev/null /etc/xivo/asterisk/xivo_ring.conf \
&& install -D -o root -g root /dev/null /etc/xivo/asterisk/xivo_fax.conf \
&& install -D -o root -g root /dev/null /etc/xivo/asterisk/xivo_in_callerid.conf
EXPOSE 4573
# Activate virtual env
ENV PATH="/opt/venv/bin:$PATH"
CMD ["wazo-agid"]