# FROM python:3.9 # RUN apt update && apt install -y libgl1-mesa-glx imagemagick # RUN pip install -U pip # # #RUN pip install -U pyyaml # # RUN pip install -U runway-python # # #runway --force-reinstall # # #RUN pip install -U tensorflow # COPY requirements.txt . # RUN pip install -r requirements.txt # COPY . . # #目前的写法是成功找到了magick文件并且python可以执行,就是magick文件没有找对 # # 修改 magick 文件的执行权限 # RUN chmod +x ./magick # ENV IMAGEMAGICK_BINARY=./magick # EXPOSE 7860 # #compo-singleone-v1-dev-acc.py # CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"] #现成magick docker镜像测试 FROM ampervue/python34 # https://github.com/ampervue/docker-ffmpeg # https://hub.docker.com/r/ampervue/ffmpeg/ MAINTAINER David Karchmer ##################################################################### # # A Docker image with everything needed to run Python/FFMPEG scripts # # Image based on Ubuntu:14.04 # # with # - Latest Python 3.4 # - Latest FFMPEG (built) # - ImageMagick # # plus a bunch of build/web essentials # ##################################################################### ENV NUM_CORES 4 WORKDIR /usr/local/src RUN git clone --depth 1 https://github.com/l-smash/l-smash \ && git clone --depth 1 git://git.videolan.org/x264.git \ && hg clone https://bitbucket.org/multicoreware/x265 \ && git clone --depth 1 git://source.ffmpeg.org/ffmpeg \ && git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git \ && git clone --depth 1 https://chromium.googlesource.com/webm/libvpx \ && git clone https://git.xiph.org/opus.git \ && git clone --depth 1 https://github.com/mulx/aacgain.git # Build L-SMASH # ================================= WORKDIR /usr/local/src/l-smash RUN ./configure \ && make -j ${NUM_CORES} \ && make install # ================================= # Build libx264 # ================================= WORKDIR /usr/local/src/x264 RUN ./configure --enable-static \ && make -j ${NUM_CORES} \ && make install # ================================= # Build libx265 # ================================= WORKDIR /usr/local/src/x265/build/linux RUN cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DENABLE_SHARED:bool=off ../../source \ && make -j ${NUM_CORES} \ && make install # ================================= # Build libfdk-aac # ================================= WORKDIR /usr/local/src/fdk-aac RUN autoreconf -fiv \ && ./configure --disable-shared \ && make -j ${NUM_CORES} \ && make install # ================================= # Build libvpx # ================================= WORKDIR /usr/local/src/libvpx RUN ./configure --disable-examples \ && make -j ${NUM_CORES} \ && make install # ================================= # Build libopus # ================================= WORKDIR /usr/local/src/opus RUN ./autogen.sh \ && ./configure --disable-shared \ && make -j ${NUM_CORES} \ && make install # ================================= # Build ffmpeg. # ================================= # NOTE: Disableling libx265 for now # as it no longer compiles # --enable-libx265 \ # WORKDIR /usr/local/src/ffmpeg RUN ./configure --extra-libs="-ldl" \ --enable-gpl \ --enable-libass \ --enable-libfdk-aac \ --enable-libfontconfig \ --enable-libfreetype \ --enable-libfribidi \ --enable-libmp3lame \ --enable-libopus \ --enable-libtheora \ --enable-libvorbis \ --enable-libvpx \ --enable-libx264 \ --enable-nonfree \ --enable-openssl \ && make -j ${NUM_CORES} \ && make install # ================================= # Remove all tmpfile and cleanup # ================================= WORKDIR /usr/local/ RUN rm -rf /usr/local/src RUN apt-get autoremove -y; apt-get clean -y # ================================= RUN pip install -U pip COPY requirements.txt . RUN pip install -r requirements.txt COPY . . EXPOSE 7860 #compo-singleone-v1-dev-acc.py CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]