-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile.headless
More file actions
60 lines (47 loc) · 2.01 KB
/
Copy pathDockerfile.headless
File metadata and controls
60 lines (47 loc) · 2.01 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
FROM ubuntu:20.04
# Set locale to avoid warnings
ENV LC_ALL=C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
# Set the environment variables for the build
ARG LATEST_TAG
ARG BETA_TAG
USER 0
WORKDIR /headless
# Update package list and upgrade installed packages
RUN apt-get update -y && apt-get upgrade -y
# Install dependencies needed to install iptvboss
RUN apt-get update && apt-get install -y --no-install-recommends \
wget cron curl sudo dpkg-dev libsndfile1-dev \
python3 python3-pip python3-requests gosu \
libgtk2.0-0 libgtk-3-0 libgl1 libasound2 libxtst6 \
libavformat* libavcodec-extra* libgdk-pixbuf2.0-0 && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Copy the Python script into the container
COPY cronitor.py /headless/scripts/
COPY configure_cron_schedule.sh /headless/scripts/
# Retrieve the latest release tag from GitHub
RUN CPU=$(dpkg-architecture -q DEB_HOST_ARCH_CPU) && \
# Build the latest release
if [ -n "$LATEST_TAG" ]; then \
wget https://github.com/walrusone/iptvboss-release/releases/download/${LATEST_TAG}/iptvboss_${LATEST_TAG#v}_${CPU}.deb && \
apt install -y ./iptvboss_${LATEST_TAG#v}_${CPU}.deb && \
rm -f iptvboss_${LATEST_TAG#v}_${CPU}.deb; \
fi && \
# Build the beta version
if [ -n "$BETA_TAG" ]; then \
wget https://github.com/walrusone/iptvboss-beta/releases/latest/download/iptvboss_${BETA_TAG#v}_${CPU}.deb && \
apt install -y ./iptvboss_${BETA_TAG#v}_${CPU}.deb && \
rm -f iptvboss_${BETA_TAG#v}_${CPU}.deb; \
fi
# Create a new user with home directory set to /headless
RUN useradd -u 911 -U -d /headless -s /bin/bash iptvboss && \
touch /headless/iptvboss-cron && \
chown iptvboss:iptvboss /headless/iptvboss-cron && \
chmod 600 /headless/iptvboss-cron
# Copy the xcserver file
COPY xcserver.sh /headless/xcserver.sh
# Make the script executable
RUN chmod +x /headless/xcserver.sh /headless/scripts/configure_cron_schedule.sh
# Expose the XC server port
EXPOSE 8001
ENTRYPOINT ["/headless/xcserver.sh"]