refactor: code structure
1. move folders from /usr/* to /usr/local/* 2. supervisord controls everything
|
|
@ -34,7 +34,11 @@ ARG TINI_VERSION=v0.9.0
|
||||||
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /bin/tini
|
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /bin/tini
|
||||||
RUN chmod +x /bin/tini
|
RUN chmod +x /bin/tini
|
||||||
|
|
||||||
ADD image/usr/lib/web/requirements.txt /tmp/
|
# ffmpeg
|
||||||
|
RUN mkdir -p /usr/local/ffmpeg \
|
||||||
|
&& curl -sSL https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz | tar xJvf - -C /usr/local/ffmpeg/ --strip 1
|
||||||
|
|
||||||
|
ADD image/usr/local/lib/web/requirements.txt /tmp/
|
||||||
RUN pip install setuptools wheel && pip install -r /tmp/requirements.txt
|
RUN pip install setuptools wheel && pip install -r /tmp/requirements.txt
|
||||||
ADD image /
|
ADD image /
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,68 +1,59 @@
|
||||||
|
[supervisord]
|
||||||
|
redirect_stderr=true
|
||||||
|
stopsignal=QUIT
|
||||||
|
autorestart=true
|
||||||
|
directory=/root
|
||||||
|
|
||||||
|
[program:nginx]
|
||||||
|
priority=10
|
||||||
|
command=nginx -c /etc/nginx/nginx.conf -g 'daemon off;'
|
||||||
|
stdout_logfile=/var/log/nginx.log
|
||||||
|
|
||||||
|
[program:web]
|
||||||
|
priority=10
|
||||||
|
directory=/usr/local/lib/web
|
||||||
|
command=/usr/local/lib/web/run.py
|
||||||
|
stdout_logfile=/var/log/web.log
|
||||||
|
|
||||||
|
[group:x]
|
||||||
|
programs=xvfb,wm,lxpanel,pcmanfm,x11vnc,novnc
|
||||||
|
|
||||||
[program:xvfb]
|
[program:xvfb]
|
||||||
priority=10
|
priority=10
|
||||||
directory=/
|
command=/usr/local/bin/xvfb.sh
|
||||||
command=/usr/bin/Xvfb :1 -screen 0 1024x768x16
|
|
||||||
user=root
|
|
||||||
autostart=true
|
|
||||||
autorestart=true
|
|
||||||
stopsignal=KILL
|
stopsignal=KILL
|
||||||
stdout_logfile=/var/log/xvfb.log
|
stdout_logfile=/var/log/xvfb.log
|
||||||
redirect_stderr=true
|
|
||||||
|
|
||||||
[program:wm]
|
[program:wm]
|
||||||
priority=15
|
priority=15
|
||||||
directory=/root
|
|
||||||
command=/usr/bin/openbox
|
command=/usr/bin/openbox
|
||||||
user=root
|
|
||||||
autostart=true
|
|
||||||
autorestart=true
|
|
||||||
stopsignal=QUIT
|
|
||||||
environment=DISPLAY=":1",HOME="/root",USER="root"
|
environment=DISPLAY=":1",HOME="/root",USER="root"
|
||||||
stdout_logfile=/var/log/openbox.log
|
stdout_logfile=/var/log/openbox.log
|
||||||
redirect_stderr=true
|
|
||||||
|
|
||||||
[program:lxpanel]
|
[program:lxpanel]
|
||||||
priority=15
|
priority=15
|
||||||
directory=%HOME%
|
directory=%HOME%
|
||||||
command=/usr/bin/lxpanel --profile LXDE
|
command=/usr/bin/lxpanel --profile LXDE
|
||||||
user=%USER%
|
user=%USER%
|
||||||
autostart=true
|
|
||||||
autorestart=true
|
|
||||||
stopsignal=QUIT
|
|
||||||
environment=DISPLAY=":1",HOME="%HOME%",USER="%USER%"
|
environment=DISPLAY=":1",HOME="%HOME%",USER="%USER%"
|
||||||
stdout_logfile=/var/log/lxpanel.log
|
stdout_logfile=/var/log/lxpanel.log
|
||||||
redirect_stderr=true
|
|
||||||
|
|
||||||
[program:pcmanfm]
|
[program:pcmanfm]
|
||||||
priority=15
|
priority=15
|
||||||
directory=%HOME%
|
directory=%HOME%
|
||||||
command=/usr/bin/pcmanfm --desktop --profile LXDE
|
command=/usr/bin/pcmanfm --desktop --profile LXDE
|
||||||
user=%USER%
|
user=%USER%
|
||||||
autostart=true
|
|
||||||
autorestart=true
|
|
||||||
stopsignal=QUIT
|
|
||||||
environment=DISPLAY=":1",HOME="%HOME%",USER="%USER%"
|
environment=DISPLAY=":1",HOME="%HOME%",USER="%USER%"
|
||||||
stdout_logfile=/var/log/pcmanfm.log
|
stdout_logfile=/var/log/pcmanfm.log
|
||||||
|
|
||||||
[program:x11vnc]
|
[program:x11vnc]
|
||||||
priority=20
|
priority=20
|
||||||
directory=/
|
|
||||||
command=x11vnc -display :1 -xkb -forever -shared -repeat
|
command=x11vnc -display :1 -xkb -forever -shared -repeat
|
||||||
user=root
|
|
||||||
autostart=true
|
|
||||||
autorestart=true
|
|
||||||
stopsignal=QUIT
|
|
||||||
stdout_logfile=/var/log/x11vnc.log
|
stdout_logfile=/var/log/x11vnc.log
|
||||||
redirect_stderr=true
|
|
||||||
|
|
||||||
[program:novnc]
|
[program:novnc]
|
||||||
priority=25
|
priority=25
|
||||||
directory=/usr/lib/noVNC/
|
directory=/usr/local/lib/novnc/
|
||||||
command=/usr/lib/noVNC/utils/launch.sh --listen 6081
|
command=/usr/local/lib/novnc/utils/launch.sh --listen 6081
|
||||||
user=root
|
|
||||||
autostart=true
|
|
||||||
autorestart=true
|
|
||||||
stopsignal=QUIT
|
|
||||||
stdout_logfile=/var/log/novnc.log
|
stdout_logfile=/var/log/novnc.log
|
||||||
redirect_stderr=true
|
|
||||||
stopasgroup=true
|
stopasgroup=true
|
||||||
|
|
|
||||||
|
|
@ -22,19 +22,17 @@ if [ "$USER" != "root" ]; then
|
||||||
fi
|
fi
|
||||||
HOME=/home/$USER
|
HOME=/home/$USER
|
||||||
echo "$USER:$PASSWORD" | chpasswd
|
echo "$USER:$PASSWORD" | chpasswd
|
||||||
cp -r /root/.gtkrc-2.0 ${HOME}
|
cp -r /root/.* ${HOME}
|
||||||
fi
|
fi
|
||||||
sed -i "s|%USER%|$USER|" /etc/supervisor/conf.d/supervisord.conf
|
sed -i "s|%USER%|$USER|" /etc/supervisor/conf.d/supervisord.conf
|
||||||
sed -i "s|%HOME%|$HOME|" /etc/supervisor/conf.d/supervisord.conf
|
sed -i "s|%HOME%|$HOME|" /etc/supervisor/conf.d/supervisord.conf
|
||||||
|
|
||||||
# home folder
|
# home folder
|
||||||
mkdir -p $HOME/.config/pcmanfm/LXDE/
|
mkdir -p $HOME/.config/pcmanfm/LXDE/
|
||||||
ln -sf /usr/share/doro-lxde-wallpapers/desktop-items-0.conf $HOME/.config/pcmanfm/LXDE/
|
ln -sf /usr/local/share/doro-lxde-wallpapers/desktop-items-0.conf $HOME/.config/pcmanfm/LXDE/
|
||||||
chown -R $USER:$USER $HOME
|
chown -R $USER:$USER $HOME
|
||||||
|
|
||||||
# clearup
|
# clearup
|
||||||
PASSWORD=
|
PASSWORD=
|
||||||
|
|
||||||
cd /usr/lib/web && ./run.py 2>&1 &
|
|
||||||
nginx -c /etc/nginx/nginx.conf
|
|
||||||
exec /bin/tini -- /usr/bin/supervisord -n
|
exec /bin/tini -- /usr/bin/supervisord -n
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
exec /usr/bin/Xvfb :1 -screen 0 1024x768x16
|
||||||
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 675 B After Width: | Height: | Size: 675 B |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 1000 B After Width: | Height: | Size: 1000 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |