rogerxavier commited on
Commit
0c59880
1 Parent(s): bc21490

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +159 -17
Dockerfile CHANGED
@@ -1,37 +1,179 @@
1
- FROM python:3.9
2
- RUN apt update && apt install -y libgl1-mesa-glx imagemagick
3
 
4
 
5
 
6
- RUN pip install -U pip
7
- # #RUN pip install -U pyyaml
8
- # RUN pip install -U runway-python
9
- # #runway --force-reinstall
10
- # #RUN pip install -U tensorflow
11
 
12
 
13
- COPY requirements.txt .
14
- RUN pip install -r requirements.txt
15
 
16
- COPY . .
17
 
18
- #目前的写法是成功找到了magick文件并且python可以执行,就是magick文件没有找对
19
- # 修改 magick 文件的执行权限
20
- RUN chmod +x ./magick
21
 
22
- ENV IMAGEMAGICK_BINARY=./magick
23
 
24
 
25
- EXPOSE 7860
26
 
27
- #compo-singleone-v1-dev-acc.py
28
- CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
 
 
31
 
 
 
 
 
 
 
 
 
 
32
 
 
 
 
 
 
 
 
33
 
34
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
 
37
 
 
1
+ # FROM python:3.9
2
+ # RUN apt update && apt install -y libgl1-mesa-glx imagemagick
3
 
4
 
5
 
6
+ # RUN pip install -U pip
7
+ # # #RUN pip install -U pyyaml
8
+ # # RUN pip install -U runway-python
9
+ # # #runway --force-reinstall
10
+ # # #RUN pip install -U tensorflow
11
 
12
 
13
+ # COPY requirements.txt .
14
+ # RUN pip install -r requirements.txt
15
 
16
+ # COPY . .
17
 
18
+ # #目前的写法是成功找到了magick文件并且python可以执行,就是magick文件没有找对
19
+ # # 修改 magick 文件的执行权限
20
+ # RUN chmod +x ./magick
21
 
22
+ # ENV IMAGEMAGICK_BINARY=./magick
23
 
24
 
25
+ # EXPOSE 7860
26
 
27
+ # #compo-singleone-v1-dev-acc.py
28
+ # CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+ #现成magick docker镜像测试
38
+
39
+ FROM ampervue/python34
40
+
41
+ # https://github.com/ampervue/docker-ffmpeg
42
+ # https://hub.docker.com/r/ampervue/ffmpeg/
43
+
44
+ MAINTAINER David Karchmer <dkarchmer@ampervue.com>
45
+
46
+ #####################################################################
47
+ #
48
+ # A Docker image with everything needed to run Python/FFMPEG scripts
49
+ #
50
+ # Image based on Ubuntu:14.04
51
+ #
52
+ # with
53
+ # - Latest Python 3.4
54
+ # - Latest FFMPEG (built)
55
+ # - ImageMagick
56
+ #
57
+ # plus a bunch of build/web essentials
58
+ #
59
+ #####################################################################
60
+
61
+ ENV NUM_CORES 4
62
 
63
 
64
+ WORKDIR /usr/local/src
65
 
66
+ RUN git clone --depth 1 https://github.com/l-smash/l-smash \
67
+ && git clone --depth 1 git://git.videolan.org/x264.git \
68
+ && hg clone https://bitbucket.org/multicoreware/x265 \
69
+ && git clone --depth 1 git://source.ffmpeg.org/ffmpeg \
70
+ && git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git \
71
+ && git clone --depth 1 https://chromium.googlesource.com/webm/libvpx \
72
+ && git clone https://git.xiph.org/opus.git \
73
+ && git clone --depth 1 https://github.com/mulx/aacgain.git
74
+
75
 
76
+ # Build L-SMASH
77
+ # =================================
78
+ WORKDIR /usr/local/src/l-smash
79
+ RUN ./configure \
80
+ && make -j ${NUM_CORES} \
81
+ && make install
82
+ # =================================
83
 
84
 
85
+ # Build libx264
86
+ # =================================
87
+ WORKDIR /usr/local/src/x264
88
+ RUN ./configure --enable-static \
89
+ && make -j ${NUM_CORES} \
90
+ && make install
91
+ # =================================
92
+
93
+
94
+ # Build libx265
95
+ # =================================
96
+ WORKDIR /usr/local/src/x265/build/linux
97
+ RUN cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DENABLE_SHARED:bool=off ../../source \
98
+ && make -j ${NUM_CORES} \
99
+ && make install
100
+ # =================================
101
+
102
+ # Build libfdk-aac
103
+ # =================================
104
+ WORKDIR /usr/local/src/fdk-aac
105
+ RUN autoreconf -fiv \
106
+ && ./configure --disable-shared \
107
+ && make -j ${NUM_CORES} \
108
+ && make install
109
+ # =================================
110
+
111
+ # Build libvpx
112
+ # =================================
113
+ WORKDIR /usr/local/src/libvpx
114
+ RUN ./configure --disable-examples \
115
+ && make -j ${NUM_CORES} \
116
+ && make install
117
+ # =================================
118
+
119
+ # Build libopus
120
+ # =================================
121
+ WORKDIR /usr/local/src/opus
122
+ RUN ./autogen.sh \
123
+ && ./configure --disable-shared \
124
+ && make -j ${NUM_CORES} \
125
+ && make install
126
+ # =================================
127
+
128
+
129
+ # Build ffmpeg.
130
+ # =================================
131
+
132
+ # NOTE: Disableling libx265 for now
133
+ # as it no longer compiles
134
+ # --enable-libx265 \
135
+ #
136
+ WORKDIR /usr/local/src/ffmpeg
137
+ RUN ./configure --extra-libs="-ldl" \
138
+ --enable-gpl \
139
+ --enable-libass \
140
+ --enable-libfdk-aac \
141
+ --enable-libfontconfig \
142
+ --enable-libfreetype \
143
+ --enable-libfribidi \
144
+ --enable-libmp3lame \
145
+ --enable-libopus \
146
+ --enable-libtheora \
147
+ --enable-libvorbis \
148
+ --enable-libvpx \
149
+ --enable-libx264 \
150
+ --enable-nonfree \
151
+ --enable-openssl \
152
+ && make -j ${NUM_CORES} \
153
+ && make install
154
+ # =================================
155
+
156
+ # Remove all tmpfile and cleanup
157
+ # =================================
158
+ WORKDIR /usr/local/
159
+ RUN rm -rf /usr/local/src
160
+ RUN apt-get autoremove -y; apt-get clean -y
161
+ # =================================
162
+
163
+
164
+ RUN pip install -U pip
165
+
166
+ COPY requirements.txt .
167
+ RUN pip install -r requirements.txt
168
+
169
+ COPY . .
170
+
171
+
172
+ EXPOSE 7860
173
+
174
+ #compo-singleone-v1-dev-acc.py
175
+ CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]
176
+
177
 
178
 
179