- consolidated docker run statements

- you can now control the CPU limit of the running AOT process via changing the contents of /root/aot_cpu_limit (gets it's initial value from the env variable AOT_CPU_LIMIT which if set to zero imposes zero limits)
- set limits on log file sizes
This commit is contained in:
2024-03-07 22:51:44 -07:00
parent fdf2cffd02
commit 61eadc821e
5 changed files with 129 additions and 114 deletions
+51 -58
View File
@@ -5,7 +5,13 @@ ENV DEBIAN_FRONTEND noninteractive
ENV LC_ALL C.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
ENV WINEARCH win64
ENV DISPLAY :0
ENV WINEPREFIX /root/prefix32
ENV AOTDIR "$WINEPREFIX/drive_c/Program Files (x86)/AgeOfTime"
WORKDIR /root/
COPY webaudio.js /root/
RUN dpkg --add-architecture i386 && \
apt-get update && apt-get -y install python2 python-is-python2 xvfb x11vnc xdotool wget tar supervisor net-tools fluxbox gnupg2 && \
wget -O - https://dl.winehq.org/wine-builds/winehq.key | apt-key add - && \
@@ -13,73 +19,60 @@ RUN dpkg --add-architecture i386 && \
apt-get update && apt-get -y install \
wmctrl \
winehq-stable \
libgl1:i386 bzip2 \
gstreamer1.0-plugins-good \
gstreamer1.0-pulseaudio \
gstreamer1.0-tools \
libglu1-mesa \
libgtk2.0-0 \
libncursesw5 \
libopenal1 \
libsdl-image1.2 \
libsdl-ttf2.0-0 \
libsdl1.2debian \
libsndfile1 \
# libgl1:i386 bzip2 \
# gstreamer1.0-plugins-good \
# gstreamer1.0-pulseaudio \
# gstreamer1.0-tools \
# libglu1-mesa \
# libgtk2.0-0 \
# libncursesw5 \
# libopenal1 \
# libsdl-image1.2 \
# libsdl-ttf2.0-0 \
# libsdl1.2debian \
# libsndfile1 \
pulseaudio \
ucspi-tcp \
cpulimit && \
mkdir /opt/wine-stable/share/wine/mono && wget -O - https://dl.winehq.org/wine/wine-mono/9.0.0/wine-mono-9.0.0-x86.tar.xz | tar -xJv -C /opt/wine-stable/share/wine/mono && \
apt-get -y full-upgrade && apt-get clean && rm -rf /var/lib/apt/lists/*
# the following can be used to skip download and use local file
# COPY AgeOfTime-29.exe /root/AgeOfTime-29.exe
ENV WINEPREFIX /root/prefix32
ENV WINEARCH win64
ENV DISPLAY :0
ENV AOTDIR "$WINEPREFIX/drive_c/Program Files/AgeOfTime"
RUN wget -P /mono https://dl.winehq.org/wine/wine-mono/9.0.0/wine-mono-9.0.0-x86.msi && \
wineboot -f -u && sleep 10 && xvfb-run msiexec /i /mono/wine-mono-9.0.0-x86.msi /quiet
# wineboot -u && msiexec /i /opt/wine-stable/share/wine/gecko/wine-gecko-2.47.1-x86.msi && \
# rm -rf /mono/wine-mono-4.9.4.msi
# download and install AgeOfTime
RUN cd /root && \
# nohup /usr/bin/Xvfb :0 -screen 0 1024x768x24 && sleep 5 && \
apt-get -y full-upgrade && apt-get clean && rm -rf /var/lib/apt/lists/* && \
# install mono for wine
wget -P /mono https://dl.winehq.org/wine/wine-mono/9.0.0/wine-mono-9.0.0-x86.msi && \
wineboot -i -f -u && \
sleep 10 && \
xvfb-run msiexec /i /mono/wine-mono-9.0.0-x86.msi /quiet && \
rm -rf /mono/wine-mono-9.0.0-x86.msi && \
# done with wine stuff
# download and install AgeOfTime
cd /root && \
wget https://ageoftime.com/files/AgeOfTime-29.exe && \
# mkdir -p "$WINEPREFIX/drive_c/Program Files/" && \
cd "$WINEPREFIX/drive_c/" && \
chmod +x /root/AgeOfTime-29.exe && \
xvfb-run wine /root/AgeOfTime-29.exe -s && \
rm -f /root/AgeOfTime-29.exe
# mv "$WINEPREFIX/drive_c/Program Files/AgeOfTime" "$WINEPREFIX/drive_c/AgeOfTime"
WORKDIR /root/
RUN wget -O - https://github.com/novnc/noVNC/archive/v1.1.0.tar.gz | tar -xzv -C /root/ && mv /root/noVNC-1.1.0 /root/novnc && ln -s /root/novnc/vnc_lite.html /root/novnc/index.html && \
wget -O - https://github.com/novnc/websockify/archive/v0.9.0.tar.gz | tar -xzv -C /root/ && mv /root/websockify-0.9.0 /root/novnc/utils/websockify
# lets copy age of time files instead of install
# COPY ["AgeOfTime", "$WINEPREFIX/drive_c/Program Files/AgeOfTime"]
# Force vnc_lite.html to be used for novnc, to avoid having the directory listing page.
# Additionally, turn off the control bar. Finally, add a hook to start audio.
COPY webaudio.js /root/novnc/core/
RUN rm -f /root/novnc/index.html && ln -s /root/novnc/vnc_lite.html /root/novnc/index.html \
&& sed -i 's/display:flex/display:none/' /root/novnc/app/styles/base.css \
&& sed -i "/import RFB/a \
import WebAudio from './core/webaudio.js'" \
/root/novnc/vnc_lite.html \
&& sed -i "/function connected(e)/a \
var wa = new WebAudio('ws://localhost:8081/websockify'); \
document.getElementsByTagName('canvas')[0].addEventListener('keydown', e => { wa.start(); });" \
/root/novnc/vnc_lite.html
rm -f /root/AgeOfTime-29.exe && \
# install noVNC \
wget -O - https://github.com/novnc/noVNC/archive/v1.1.0.tar.gz | tar -xzv -C /root/ && mv /root/noVNC-1.1.0 /root/novnc && ln -s /root/novnc/vnc_lite.html /root/novnc/index.html && \
wget -O - https://github.com/novnc/websockify/archive/v0.9.0.tar.gz | tar -xzv -C /root/ && mv /root/websockify-0.9.0 /root/novnc/utils/websockify && \
# install noVNC audio patch
# Force vnc_lite.html to be used for novnc, to avoid having the directory listing page.
# Additionally, turn off the control bar. Finally, add a hook to start audio.
mv /root/webaudio.js /root/novnc/core/webaudio.js && \
rm -f /root/novnc/index.html && ln -s /root/novnc/vnc_lite.html /root/novnc/index.html && \
sed -i 's/display:flex/display:none/' /root/novnc/app/styles/base.css && \
sed -i "/import RFB/a \
import WebAudio from './core/webaudio.js'" \
/root/novnc/vnc_lite.html && \
sed -i "/function connected(e)/a \
var wa = new WebAudio('ws://localhost:8081/websockify'); \
document.getElementsByTagName('canvas')[0].addEventListener('keydown', e => { wa.start(); });" \
/root/novnc/vnc_lite.html
COPY restart-aot-crash.sh /root/restart-aot-crash.sh
COPY start-aot.sh /root/start-aot.sh
COPY start.sh /root/start.sh
RUN chmod +x /root/*.sh && \
ln -s "$AOTDIR" /root/AgeOfTime
ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf
ADD restart-aot-crash.sh /root/restart-aot-crash.sh
ADD start-aot.sh /root/start-aot.sh
RUN chmod +x /root/restart-aot-crash.sh && chmod +x /root/start-aot.sh
EXPOSE 8080
USER root
CMD ["/usr/bin/supervisord"]
CMD ["/root/start.sh"]