mirror of
https://github.com/linuxserver/docker-ffmpeg.git
synced 2026-02-20 04:56:23 +08:00
initial stash to have source to build from
This commit is contained in:
parent
1f06f8fdb0
commit
002da49eed
84
Dockerfile
Normal file
84
Dockerfile
Normal file
@ -0,0 +1,84 @@
|
||||
FROM lsiobase/ffmpeg:bin as binstage
|
||||
FROM lsiobase/cloud9:files as c9files
|
||||
FROM lsiobase/ubuntu:bionic
|
||||
|
||||
# Add files from stages
|
||||
COPY --from=binstage / /
|
||||
COPY --from=c9files /buildout/ /
|
||||
|
||||
# set version label
|
||||
ARG BUILD_DATE
|
||||
ARG VERSION
|
||||
ARG FFMPEGWEB_COMMIT
|
||||
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
||||
LABEL maintainer="thelamer"
|
||||
|
||||
# hardware env
|
||||
ENV \
|
||||
LIBVA_DRIVERS_PATH="/usr/lib/x86_64-linux-gnu/dri" \
|
||||
NVIDIA_DRIVER_CAPABILITIES="compute,video,utility"
|
||||
|
||||
RUN \
|
||||
echo "**** install build-deps ffmpeg-web ****" && \
|
||||
apt-get update && \
|
||||
apt-get install -y \
|
||||
python3-pip && \
|
||||
echo "**** install runtime ffmpeg-web ****" && \
|
||||
apt-get install -y \
|
||||
python3 && \
|
||||
echo "**** install runtime ffmpeg ****" && \
|
||||
apt-get install -y \
|
||||
i965-va-driver \
|
||||
libexpat1 \
|
||||
libgl1-mesa-dri \
|
||||
libglib2.0-0 \
|
||||
libgomp1 \
|
||||
libharfbuzz0b \
|
||||
libv4l-0 \
|
||||
libx11-6 \
|
||||
libxcb1 \
|
||||
libxext6 \
|
||||
libxml2 && \
|
||||
echo "**** install stuff specific to the dev container ****" && \
|
||||
apt-get install -y \
|
||||
git \
|
||||
npm && \
|
||||
npm install -g nodemon && \
|
||||
echo "**** install web app from git ****" && \
|
||||
if [ -z ${FFMPEGWEB_COMMIT+x} ]; then \
|
||||
FFMPEGWEB_COMMIT=$(curl -sX GET https://api.github.com/repos/linuxserver/docker-ffmpeg/commits/web \
|
||||
| awk '/sha/{print $4;exit}' FS='[""]'); \
|
||||
fi && \
|
||||
git clone \
|
||||
https://github.com/linuxserver/docker-ffmpeg.git
|
||||
/app/ffmpeg-web && \
|
||||
git \
|
||||
--git-dir /app/ffmpeg-web/.git \
|
||||
checkout -f ${FFMPEGWEB_COMMIT} && \
|
||||
pip3 install \
|
||||
-r /app/ffmpeg-web/requirements.txt && \
|
||||
echo "**** permissions ****" && \
|
||||
mkdir -p /applogs/ && \
|
||||
chown -R abc:abc \
|
||||
/app/ffmpeg-web \
|
||||
/applogs && \
|
||||
/c9sdk/build/standalone \
|
||||
/c9bins
|
||||
usermod -aG sudo \
|
||||
abc && \
|
||||
chsh abc -s /bin/bash && \
|
||||
sed -e 's/%sudo ALL=(ALL:ALL) ALL/%sudo ALL=(ALL:ALL) NOPASSWD: ALL/g' \
|
||||
-i /etc/sudoers && \
|
||||
sed -e 's/^wheel:\(.*\)/wheel:\1,abc/g' -i /etc/group && \
|
||||
echo "**** clean up ****" && \
|
||||
rm -rf \
|
||||
/root \
|
||||
/var/lib/apt/lists/* \
|
||||
/var/tmp/* &&
|
||||
mkdir /root
|
||||
|
||||
# add local files
|
||||
COPY /root /
|
||||
|
||||
# ports
|
||||
EXPOSE 8787 8000
|
||||
1
public/index.html
Normal file
1
public/index.html
Normal file
@ -0,0 +1 @@
|
||||
Hello World
|
||||
2
reqirements.txt
Normal file
2
reqirements.txt
Normal file
@ -0,0 +1,2 @@
|
||||
aiohttp
|
||||
python-socketio
|
||||
6
root/etc/services.d/c9/run
Normal file
6
root/etc/services.d/c9/run
Normal file
@ -0,0 +1,6 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
cd /c9sdk
|
||||
HOME=/c9bins exec \
|
||||
s6-setuidgid abc \
|
||||
/c9bins/.c9/node/bin/node server.js --listen 0.0.0.0 -p 8000 -w /app/ffmpeg-web -a :
|
||||
7
root/etc/services.d/web/run
Normal file
7
root/etc/services.d/web/run
Normal file
@ -0,0 +1,7 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
# Run App in development mode
|
||||
cd /app/ffmpeg-web
|
||||
exec \
|
||||
s6-setuidgid abc nodemon \
|
||||
--exec python3 server.py > /applogs/app.log
|
||||
15
server.py
Normal file
15
server.py
Normal file
@ -0,0 +1,15 @@
|
||||
from aiohttp import web
|
||||
import socketio
|
||||
|
||||
sio = socketio.AsyncServer()
|
||||
app = web.Application()
|
||||
sio.attach(app)
|
||||
|
||||
async def index(request):
|
||||
with open('./public/index.html') as f:
|
||||
return web.Response(text=f.read(), content_type='text/html')
|
||||
|
||||
app.router.add_get('/', index)
|
||||
|
||||
if __name__ == '__main__':
|
||||
web.run_app(app, port=8787)
|
||||
Loading…
x
Reference in New Issue
Block a user