-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDockerfile
99 lines (87 loc) · 2.04 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
FROM python:3.7-alpine
ARG FFMPEG_VERSION=4.2.1
ARG PREFIX=/opt/ffmpeg
ARG LD_LIBRARY_PATH=/opt/ffmpeg/lib
ARG MAKEFLAGS="-j4"
# FFmpeg build dependencies.
RUN apk add --update --no-cache \
build-base \
coreutils \
gcc \
lame-dev \
libressl \
libxcb \
libxcb-dev \
libressl-dev \
opus-dev \
pkgconf \
pkgconfig \
rtmpdump-dev \
wget \
x264-dev \
x265-dev \
yasm \
supervisor \
docker \
git \
bash \
python3-dev \
py3-pip \
jpeg-dev \
zlib-dev \
musl-dev \
linux-headers \
libc-dev
# Get ffmpeg source.
RUN cd /tmp/ && \
wget http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz && \
tar zxf ffmpeg-${FFMPEG_VERSION}.tar.gz && rm ffmpeg-${FFMPEG_VERSION}.tar.gz
# Compile ffmpeg.
RUN cd /tmp/ffmpeg-${FFMPEG_VERSION} && \
./configure \
--enable-version3 \
--enable-gpl \
--enable-nonfree \
--enable-small \
--enable-libxcb \
--enable-openssl \
--disable-debug \
--disable-doc \
--disable-ffplay \
--extra-cflags="-I${PREFIX}/include" \
--extra-ldflags="-L${PREFIX}/lib" \
--extra-libs="-lpthread -lm" \
--prefix="${PREFIX}" && \
make && make install && make distclean
ENV LIBRARY_PATH=/lib:/usr/lib
ENV PATH=/opt/ffmpeg/bin:$PATH
RUN apk add --update \
ca-certificates \
opus \
rtmpdump \
x264-dev \
x265-dev \
postgresql-dev \
libffi-dev
RUN rm -rf /var/cache/apk/* /tmp/*
RUN pip install --upgrade pip
RUN pip install --upgrade setuptools setuptools-rust
RUN pip install --upgrade uwsgi
ENV CRYPTOGRAPHY_DONT_BUILD_RUST=1
ADD setup.py /tmp/setup.py
ADD MANIFEST.in /tmp/MANIFEST.in
ADD requirements.txt /tmp/requirements.txt
COPY galloper /tmp/galloper
RUN pip install git+https://github.com/carrier-io/[email protected]
RUN pip install cryptography==3.4.8
RUN cd /tmp && python setup.py install && rm -rf /tmp/*
RUN mkdir /tmp/tasks
RUN mkdir /tmp/db
ADD start.sh /tmp/start.sh
RUN chmod +x /tmp/start.sh
WORKDIR /tmp
RUN pip install selenium==3.141.0
RUN echo "Starting point" > /var/log/worker.log
SHELL ["/bin/bash", "-c"]
EXPOSE 5000
ENTRYPOINT ["/tmp/start.sh"]