2020-01-14 00:28:14 +13:00
|
|
|
FROM debian:stretch-slim
|
2020-01-13 21:05:38 +13:00
|
|
|
|
|
|
|
ARG USERNAME=neko
|
|
|
|
ARG USER_UID=1000
|
|
|
|
ARG USER_GID=$USER_UID
|
|
|
|
|
|
|
|
# Avoid warnings by switching to noninteractive
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
2020-01-14 00:28:14 +13:00
|
|
|
# Install dependencies ttf-freefont
|
2020-01-13 21:05:38 +13:00
|
|
|
RUN apt-get update \
|
2020-01-14 12:12:55 +13:00
|
|
|
&& apt-get -y install curl apt-utils supervisor openbox dbus-x11 xvfb pulseaudio firefox-esr \
|
2020-01-14 22:39:47 +13:00
|
|
|
&& apt-get -y install gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-pulseaudio \
|
2020-01-26 04:14:46 +13:00
|
|
|
&& apt-get -y install libxcb-xkb-dev libxkbcommon-x11-dev xclip \
|
2020-01-13 21:05:38 +13:00
|
|
|
#
|
|
|
|
# Create a non-root user
|
|
|
|
&& groupadd --gid $USER_GID $USERNAME \
|
|
|
|
&& useradd --uid $USER_UID --gid $USERNAME --shell /bin/bash --create-home $USERNAME \
|
|
|
|
&& adduser $USERNAME audio \
|
|
|
|
&& adduser $USERNAME video \
|
|
|
|
&& adduser $USERNAME pulse \
|
|
|
|
#
|
2020-01-14 00:28:14 +13:00
|
|
|
# Add sudo support for the non-root user
|
|
|
|
&& apt-get install -y sudo \
|
|
|
|
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
|
|
|
|
&& chmod 0440 /etc/sudoers.d/$USERNAME \
|
|
|
|
#
|
2020-01-13 21:05:38 +13:00
|
|
|
# Install uBlock
|
|
|
|
&& mkdir -p /usr/lib/firefox-esr/distribution/extensions \
|
|
|
|
&& curl -o /usr/lib/firefox-esr/distribution/extensions/uBlock0@raymondhill.net.xpi https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/addon-607454-latest.xpi \
|
|
|
|
#
|
|
|
|
# Setup Pulse Audio
|
2020-01-14 12:12:55 +13:00
|
|
|
&& mkdir -p /home/$USERNAME/.config/pulse/ \
|
2020-01-13 21:05:38 +13:00
|
|
|
&& echo "default-server=unix:/tmp/pulseaudio.socket" > /home/$USERNAME/.config/pulse/client.conf \
|
|
|
|
&& chown -R $USERNAME:$USERNAME /home/$USERNAME \
|
|
|
|
#
|
2020-01-14 12:12:55 +13:00
|
|
|
# Workaround for an X11 problem. See: http://blog.tigerteufel.de/?p=476
|
|
|
|
&& mkdir /tmp/.X11-unix && chmod 1777 /tmp/.X11-unix && chown $USERNAME /tmp/.X11-unix/ \
|
|
|
|
#
|
2020-01-14 00:28:14 +13:00
|
|
|
# Make directories for neko
|
|
|
|
&& mkdir -p /etc/neko /var/www \
|
|
|
|
#
|
2020-01-13 21:05:38 +13:00
|
|
|
# Clean up
|
|
|
|
&& apt-get autoremove -y \
|
|
|
|
&& apt-get clean -y \
|
|
|
|
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
|
|
|
|
|
|
|
|
#
|
|
|
|
# Copy configuation files
|
|
|
|
COPY .docker/openbox.xml /etc/neko/openbox.xml
|
|
|
|
COPY .docker/supervisord.conf /etc/neko/supervisord.conf
|
2020-01-14 00:28:14 +13:00
|
|
|
COPY .docker/default.pa /etc/pulse/default.pa
|
2020-01-14 22:39:47 +13:00
|
|
|
COPY .docker/firefox/neko.js /usr/lib/firefox-esr/mozilla.cfg
|
|
|
|
COPY .docker/firefox/autoconfig.js /usr/lib/firefox-esr/defaults/pref/autoconfig.js
|
|
|
|
COPY .docker/firefox/policies.json /usr/lib/firefox-esr/distribution/policies.json
|
2020-01-13 21:05:38 +13:00
|
|
|
|
|
|
|
#
|
|
|
|
# Neko files
|
|
|
|
COPY client/dist/ /var/www
|
|
|
|
COPY server/bin/neko /usr/bin/neko
|
|
|
|
|
2020-01-14 00:28:14 +13:00
|
|
|
USER $USERNAME
|
|
|
|
|
2020-01-13 21:05:38 +13:00
|
|
|
#
|
|
|
|
# Neko Env
|
|
|
|
ENV NEKO_USER=$USERNAME
|
|
|
|
ENV NEKO_DISPLAY=0
|
|
|
|
ENV NEKO_WIDTH=1280
|
|
|
|
ENV NEKO_HEIGHT=720
|
|
|
|
ENV NEKO_PASSWORD=neko
|
2020-01-24 06:29:20 +13:00
|
|
|
ENV NEKO_ADMIN=admin
|
2020-01-14 12:12:55 +13:00
|
|
|
ENV NEKO_BIND=:8080
|
2020-01-13 21:05:38 +13:00
|
|
|
|
2020-01-14 22:39:47 +13:00
|
|
|
# Neko Nyan (=^-ω-^=)
|
2020-01-14 00:28:14 +13:00
|
|
|
ENV NEKO_URL=https://www.youtube.com/embed/QH2-TGUlwu4
|
|
|
|
|
2020-01-13 21:05:38 +13:00
|
|
|
#
|
|
|
|
# Copy entrypoint
|
|
|
|
COPY .docker/entrypoint.sh /entrypoint.sh
|
|
|
|
|
|
|
|
#
|
2020-01-14 12:12:55 +13:00
|
|
|
# Run Service
|
2020-01-13 21:05:38 +13:00
|
|
|
CMD ["/bin/bash", "/entrypoint.sh"]
|