Spotter-VM/lxc-apps/pandora/image

89 lines
3.0 KiB
Plaintext
Raw Normal View History

IMAGE pandora_0.0.1-210106
FROM alpine3.12-python3.8_3.8.5-210106
2018-09-13 14:15:22 +02:00
RUN EOF
# Install runtime dependencies
2020-03-22 13:44:46 +01:00
apk --no-cache add ffmpeg imagemagick imlib2 libogg libtheora libvpx mkvtoolnix nginx poppler-utils py3-lxml py3-numpy py3-pillow py3-psycopg2
2018-09-13 14:15:22 +02:00
pip3 install pyinotify
# Install build dependencies
apk --no-cache add --virtual .deps autoconf automake build-base flac-dev git imlib2-dev libogg-dev libtheora-dev libtool libvpx-dev libvorbis-dev python3-dev
# Compile liboggz
2020-03-22 13:44:46 +01:00
wget https://ftp.osuosl.org/pub/xiph/releases/liboggz/liboggz-1.1.1.tar.gz -O - | tar xzf - -C /tmp
2018-09-13 14:15:22 +02:00
cd /tmp/liboggz-1.1.1
./configure
make -j $(getconf _NPROCESSORS_ONLN)
make install
# Compile libfishsound
2020-03-22 13:44:46 +01:00
wget https://ftp.osuosl.org/pub/xiph/releases/libfishsound/libfishsound-1.0.0.tar.gz -O - | tar xzf - -C /tmp
2018-09-13 14:15:22 +02:00
cd /tmp/libfishsound-1.0.0
./configure
make -j $(getconf _NPROCESSORS_ONLN)
make install
# Compile liboggplay
git clone --depth 1 https://gitlab.xiph.org/xiph/liboggplay.git /tmp/liboggplay
2018-09-13 14:15:22 +02:00
cd /tmp/liboggplay
./autogen.sh
./configure
make -j $(getconf _NPROCESSORS_ONLN)
make install
# Compile Oxframe
2020-03-22 13:44:46 +01:00
git clone --depth 1 https://code.0x2620.org/0x2620/oxframe.git /tmp/oxframe
2018-09-13 14:15:22 +02:00
cd /tmp/oxframe
sed -i '/man\/oxframe/d' Makefile
make
make install
# Clone Pandora git repositories
2020-03-22 13:44:46 +01:00
git clone --depth 1 https://code.0x2620.org/0x2620/pandora.git /srv/pandora
git clone --depth 1 https://code.0x2620.org/0x2620/oxjs.git /srv/pandora/static/oxjs
git clone --depth 1 https://code.0x2620.org/0x2620/python-ox.git /srv/pandora/src/python-ox
git clone --depth 1 https://code.0x2620.org/0x2620/oxtimelines.git /srv/pandora/src/oxtimelines
2018-09-13 14:15:22 +02:00
pip3 install -e /srv/pandora/src/python-ox
pip3 install -e /srv/pandora/src/oxtimelines
pip3 install -r /srv/pandora/requirements.txt
# Compile pyc and static files
cd /srv/pandora/pandora
ln -s config.pandora.jsonc config.jsonc
./manage.py update_static
./manage.py compile_pyc -p /srv/pandora/pandora
./manage.py collectstatic -l --noinput
# Create OS user
addgroup -S -g 8080 pandora
adduser -S -u 8080 -h /srv/pandora -s /bin/false -g pandora -G pandora pandora
2018-09-13 14:15:22 +02:00
EOF
2020-03-22 13:44:46 +01:00
COPY image.d
2018-09-13 14:15:22 +02:00
RUN EOF
# Update static files for Czech translation
cd /srv/pandora/pandora
./manage.py update_static
# Hackfix missing virtualenv
mkdir /srv/pandora/bin
ln -s /usr/bin/oxtimelines /srv/pandora/bin/oxtimelines
# Create mount with dummy conf files
mkdir /srv/pandora/conf
rm config.jsonc
ln -s /srv/pandora/conf/config.jsonc config.jsonc
ln -s /srv/pandora/conf/gunicorn_config.py gunicorn_config.py
ln -s /srv/pandora/conf/local_settings.py local_settings.py
2020-03-22 14:54:16 +01:00
chown -R pandora:pandora /srv/pandora
2018-09-13 14:17:45 +02:00
# Cleanup
apk --no-cache del .deps
find /srv/pandora -name '.git*' -exec rm -rf {} +
rm -rf /tmp/lib* /tmp/oxframe
rm -rf /root/.cache /root/.ox
2018-09-13 14:15:22 +02:00
EOF
2020-02-09 15:54:46 +01:00
CMD /bin/s6-svscan /etc/services.d