Skip to content

Instantly share code, notes, and snippets.

@vchakoshy
Created December 28, 2019 13:19
Show Gist options
  • Save vchakoshy/a54abef97fcdbc74b20eb663f5ae7e6e to your computer and use it in GitHub Desktop.
Save vchakoshy/a54abef97fcdbc74b20eb663f5ae7e6e to your computer and use it in GitHub Desktop.
Docker apache php ffmpeg cuda gpu kubernetes
FROM nightseas/ffmpeg:latest AS ffdocker
FROM php:7.2-apache
# copy libs from ffmpeg
COPY --from=ffdocker /usr/local/bin/ffprobe /usr/local/bin/ffprobe
COPY --from=ffdocker /usr/local/bin/ffmpeg /usr/local/bin/ffmpeg
COPY --from=ffdocker /usr/local/cuda-9.1 /usr/local/cuda-9.1
COPY --from=ffdocker /usr/local/bin/* /usr/local/bin/
COPY --from=ffdocker /usr/local/include/ffnvcodec /usr/local/include/
COPY --from=ffdocker /usr/local/include/libavcodec /usr/local/include/
COPY --from=ffdocker /usr/local/include/libavdevice /usr/local/include/
COPY --from=ffdocker /usr/local/include/libavfilter /usr/local/include/
COPY --from=ffdocker /usr/local/include/libavformat /usr/local/include/
COPY --from=ffdocker /usr/local/include/libavutil /usr/local/include/
COPY --from=ffdocker /usr/local/include/libswresample /usr/local/include/
COPY --from=ffdocker /usr/local/include/libswscale /usr/local/include/
RUN ln -s /usr/local/cuda-9.1 /usr/local/cuda
# environment for ffmpeg and cuda
ENV LD_LIBRARY_PATH /usr/local/cuda-9.1/targets/x86_64-linux/lib/
ENV NCCL_VERSION 2.1.15
ENV CUDA_PKG_VERSION 9-1=9.1.85-1
ENV CUDA_VERSION 9.1.85
ENV NVIDIA_DRIVER_CAPABILITIES video,compute,utility
ENV NVIDIA_REQUIRE_CUDA cuda>=9.1
ENV NVIDIA_VISIBLE_DEVICES all
RUN apt-get update \
&& apt-get install -y libpq-dev \
&& docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \
&& docker-php-ext-install pdo pdo_pgsql pgsql
COPY . /var/www/html/
RUN a2enmod rewrite
EXPOSE 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment