-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
40 lines (31 loc) · 1.25 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
36
37
38
39
40
FROM python:3.9-slim-bullseye AS compile-image
LABEL maintainer="Wazo Maintainers <dev@wazo.community>"
RUN python -m venv /opt/venv
# Activate virtual env
ENV PATH="/opt/venv/bin:$PATH"
RUN apt-get -q update
RUN apt-get -yq install gcc
COPY . /usr/src/wazo-plugind
WORKDIR /usr/src/wazo-plugind
RUN pip install -r requirements.txt
RUN python setup.py install
RUN pip install pyparsing
RUN pip install appdirs
FROM python:3.9-slim-bullseye AS build-image
COPY --from=compile-image /opt/venv /opt/venv
COPY ./etc/wazo-plugind /etc/wazo-plugind
COPY ./templates /usr/lib/wazo-plugind/templates
RUN true \
&& apt-get -q update \
&& apt-get -yq install apt-utils fakeroot gdebi-core git wget gnupg \
&& adduser --quiet --system --group --home /var/lib/wazo-plugind wazo-plugind \
&& mkdir -p /etc/wazo-plugind/conf.d \
&& install -m 755 -d -o wazo-plugind -g wazo-plugind /var/lib/wazo-plugind/rules \
&& install -d -o wazo-plugind -g wazo-plugind /var/lib/wazo-plugind/downloads \
&& install -o wazo-plugind -g wazo-plugind /dev/null /var/log/wazo-plugind.log \
&& chown -R wazo-plugind:wazo-plugind /usr/lib/wazo-plugind \
&& rm -rf /var/lib/apt/lists/*
EXPOSE 9503
# Activate virtual env
ENV PATH="/opt/venv/bin:$PATH"
CMD ["wazo-plugind"]