forked from RVgo4it/mmsgate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile_mmsgate_install
More file actions
45 lines (34 loc) · 1.17 KB
/
Dockerfile_mmsgate_install
File metadata and controls
45 lines (34 loc) · 1.17 KB
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
41
42
43
44
45
# syntax=docker/dockerfile:1
# This builds a MMSgate image from the flexisip installed and pjsip installed images
FROM flexisip-pjsip
MAINTAINER https://github.com/RVgo4it
# install needed apps
USER root
RUN apt install -y python3-suds python3-multipart gunicorn dumb-init
# Configure user mmsgate, no sudo
RUN useradd -ms /bin/bash mmsgate && \
echo 'mmsgate:notnot' | chpasswd
# user the mmsgate script runs as
USER mmsgate
WORKDIR /home/mmsgate
# data and mmsmedia will be volumes at run time
RUN mkdir ~/script && \
mkdir ~/data && \
mkdir ~/mmsmedia
# Copy over the scripts
COPY --chown=mmsgate mmsgate/mmsgate.py script
COPY --chown=mmsgate mmsgate/makexmlconf.py script
COPY --chown=mmsgate mmsgate/mmsreconcile.py script
COPY --chown=mmsgate mmsgate/regmon.py script
RUN chmod +x script/*
# Default user for the container
USER bc
WORKDIR /home/bc
# Generate the default config file
RUN sudo /home/mmsgate/script/mmsgate.py --default-config | sudo tee /etc/flexisip/mmsgate.conf
# Copy over the initial script that starts the other programs
COPY --chown=bc mmsgate/init.sh .
RUN chmod +x init.sh
# Startup config
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["/home/bc/init.sh"]