Spaces:
Runtime error
Runtime error
File size: 2,879 Bytes
df3ac6b 906a710 df3ac6b dd0e65c df3ac6b dd0e65c df3ac6b |
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 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
FROM python:3.10-bullseye
ENV DEBIAN_FRONTEND=noninteractive
ENV LIBRETIME_VERSION=4.5.0
ENV PYTHONUNBUFFERED=1
# Install System Dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
postgresql postgresql-contrib \
rabbitmq-server \
icecast2 \
liquidsoap \
nginx \
supervisor \
sudo \
curl \
git \
lsb-release \
locales \
make \
unzip \
php-fpm php-pgsql php-curl php-gd php-mbstring php-xml php-bcmath php-intl php-zip php-opcache \
gettext libpq-dev gcc libc6-dev \
&& rm -rf /var/lib/apt/lists/*
# Generate Locale
RUN echo "en_US.UTF_8 UTF-8" > /etc/locale.gen && locale-gen
# Clone LibreTime
RUN git clone --depth 1 --branch ${LIBRETIME_VERSION} https://github.com/libretime/libretime.git /usr/src/libretime
WORKDIR /usr/src/libretime
# Install Python Components
# 1. Shared
WORKDIR /usr/src/libretime/shared
RUN pip install .
# 2. API Client
WORKDIR /usr/src/libretime/api-client
RUN pip install .
# 3. API
WORKDIR /usr/src/libretime/api
RUN pip install .[prod]
# 4. Analyzer
WORKDIR /usr/src/libretime/analyzer
RUN pip install .
# 5. Playout
WORKDIR /usr/src/libretime/playout
RUN pip install .
# 6. Worker
WORKDIR /usr/src/libretime/worker
RUN pip install .
# Legacy Setup
WORKDIR /usr/src/libretime/legacy
# Install composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN composer install --no-dev --no-interaction
RUN make locale-build
# Move Legacy to final location
RUN mkdir -p /usr/share/libretime
RUN cp -r /usr/src/libretime/legacy /usr/share/libretime/legacy
# Config Setup
RUN mkdir -p /etc/libretime /var/log/libretime /var/lib/libretime /srv/libretime
# Nginx
RUN rm /etc/nginx/sites-enabled/default
COPY custom_nginx.conf /etc/nginx/custom_nginx.conf
# Supervisor
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Start Script
COPY start.sh /start.sh
COPY config.yml.template /etc/libretime/config.yml.template
RUN chmod +x /start.sh
# User Setup
RUN useradd -m -u 1000 user
RUN mkdir -p /var/log/rabbitmq
RUN chown -R user:user /var/lib/postgresql /var/lib/rabbitmq /var/log/rabbitmq /var/log/libretime /etc/libretime /var/lib/libretime /srv/libretime /var/lib/nginx /var/log/nginx /var/log/supervisor /var/run/postgresql /var/log/icecast2
# Ensure PHP run directory exists and is writable
RUN mkdir -p /run/php && chown -R user:user /run/php
# Fix PHP FPM config to run as user
# Debian 11 uses /etc/php/7.4/fpm/pool.d/www.conf
RUN sed -i 's/www-data/user/g' /etc/php/7.4/fpm/pool.d/www.conf
# Fix Icecast config to disable changeowner
RUN sed -i 's/<changeowner>/<!--<changeowner>/g' /etc/icecast2/icecast.xml
RUN sed -i 's/<\/changeowner>/<\/changeowner>-->/g' /etc/icecast2/icecast.xml
ENV RABBITMQ_NODENAME=rabbit@localhost
EXPOSE 7860
USER user
CMD ["/start.sh"]
|