forked from doitandbedone/ispyagentdvr-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
78 lines (62 loc) · 2.7 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Use Ubuntu LTS
FROM ubuntu:22.04
#Define download location variables
ARG FILE_LOCATION="https://ispyfiles.azureedge.net/downloads/Agent_Linux64_4_1_8_0.zip"
ENV FILE_LOCATION_SET=${FILE_LOCATION:+true}
ENV DEFAULT_FILE_LOCATION="https://www.ispyconnect.com/api/Agent/DownloadLocation4?platform=Linux64&fromVersion=0"
ARG DEBIAN_FRONTEND=noninteractive
ARG TZ=America/Los_Angeles
ARG name
# Download and install dependencies
RUN apt-get update \
&& apt-get install -y wget unzip software-properties-common alsa-utils
# Download/Install iSpy Agent DVR:
# Check if we were given a specific version
RUN if [ "${FILE_LOCATION_SET}" = "true" ]; then \
echo "Downloading from specific location: ${FILE_LOCATION}" && \
wget -c ${FILE_LOCATION} -O agent.zip; \
else \
#Get latest instead
echo "Downloading latest" && \
wget -c $(wget -qO- "https://www.ispyconnect.com/api/Agent/DownloadLocation4?platform=Linux64&fromVersion=0" | tr -d '"') -O agent.zip; \
fi && \
unzip agent.zip -d /agent && \
rm agent.zip
# Install libgdiplus, used for smart detection
RUN apt-get install -y libgdiplus
# Install ffmpeg
RUN add-apt-repository -y ppa:savoury1/ffmpeg4 && \
add-apt-repository -y ppa:savoury1/ffmpeg5 && \
apt-get update && \
apt-get upgrade -y && \
apt-get install -y ffmpeg
# Install Time Zone
RUN apt-get install -y tzdata
# Clean up
RUN apt-get -y --purge remove unzip wget \
&& apt autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Docker needs to run a TURN server to get webrtc traffic to and from it over forwarded ports from the host
# These are the default ports. If the ports below are modified here you'll also need to set the ports in XML/Config.xml
# for example <TurnServerPort>3478</TurnServerPort><TurnServerMinPort>50000</TurnServerMinPort><TurnServerMaxPort>50010</TurnServerMaxPort>
# The main server port is overridden by creating a text file called port.txt in the root directory containing the port number, eg: 8090
# To access the UI you must use the local IP address of the host, NOT localhost - for example http://192.168.1.12:8090/
# Modify permission for execution
RUN echo "Adding executable permissions" && \
chmod +x /agent/Agent && \
chmod +x /agent/agent-register.sh && \
chmod +x /agent/agent-reset.sh && \
chmod +x /agent/agent-reset-local-login.sh
# Define default environment variables
ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# Main UI port
EXPOSE 8090
# TURN server port
EXPOSE 3478/udp
# TURN server UDP port range
EXPOSE 50000-50010/udp
# Data volumes
VOLUME ["/agent/Media/XML", "/agent/Media/WebServerRoot/Media", "/agent/Commands"]
# Define service entrypoint
CMD ["/agent/Agent"]