forked from bubblesub/bubblesub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
71 lines (60 loc) · 2.01 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
FROM ubuntu:latest
MAINTAINER rr- "https://github.com/rr-"
ENV SYSTEM_PACKAGES="\
build-essential software-properties-common locales autoconf automake \
libtool git-core pkg-config wget nasm libxkbcommon-x11-0"
ENV MPV_PACKAGES="\
libmpv-dev"
ENV FFMPEG_PACKAGES="\
libavcodec-dev libavformat-dev libavdevice-dev zlib1g-dev"
ENV BUBBLESUB_PACKAGES="\
python3.9 python3.9-dev python3.9-distutils enchant libfftw3-dev xvfb qt5-default"
ENV EXTRA_PACKAGES="\
neovim"
# Disable user-interaction
ENV DEBIAN_FRONTEND noninteractive
# Install dependencies
RUN apt-get update && \
apt-get install --no-install-suggests --no-install-recommends -y \
$SYSTEM_PACKAGES \
$MPV_PACKAGES \
$FFMPEG_PACKAGES \
$BUBBLESUB_PACKAGES \
$EXTRA_PACKAGES
# Cleanup
RUN apt-get clean -y && \
rm -rf /var/lib/apt/lists/*
# Set Python environment
RUN wget https://bootstrap.pypa.io/get-pip.py -O get-pip.py && \
python3.9 get-pip.py && \
python3.9 -m pip install setuptools && \
python3.9 -m pip install Cython # https://github.com/pyFFTW/pyFFTW/issues/252
# Disable git sslVerify
RUN git config --global http.sslVerify false
# Install ffms2
RUN git clone https://github.com/FFMS/ffms2.git && \
cd ffms2 && \
./autogen.sh && \
make && \
make install
WORKDIR bubblesub
# Install bubblesub dependencies
RUN mkdir -p bubblesub && \
touch bubblesub/__init__.py
COPY setup.py .
COPY pyproject.toml .
RUN locale-gen en_US.UTF-8 && \
export LC_ALL=en_US.UTF-8 && \
python3.9 -m pip install -e .[develop]
# Install bubblesub
COPY bubblesub bubblesub
# ...but not local development garbage
RUN find . -type d -name __pycache__ -exec rm -r {} \+
# Find libffms2.so
RUN ldconfig
# Run pytest
CMD \
# start a virtual X server for UI tests
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX; \
# run the tests
python3.9 -m pytest bubblesub/