nurdism / neko

A self hosted virtual browser (rabb.it clone) that runs in docker.
Apache License 2.0
2.04k stars 186 forks source link

[FEATURE] xfce desktop container #81

Closed itskenny0 closed 4 years ago

itskenny0 commented 4 years ago

Could you add an xfce4 container that just starts a desktop with chromium installed? I primarily get my chinese cartoons from nyaa, so I've hacked this together for now:

docker exec -it neko_neko_1 apt update
docker exec -it neko_neko_1 apt -y install xfce4 mpv qbittorrent
docker exec -it neko_neko_1 bash
sudo -u neko nohup xfce4-session &

This works great, but it would be much cleaner if a container was already available that does this.

m1k1o commented 4 years ago

@itskenny0 you can create your own container, just like here:

https://github.com/nurdism/neko/blob/master/.docker/files/firefox/Dockerfile

itskenny0 commented 4 years ago

@m1k1o I know, but I'm not that great with Docker and I would imagine that I'm not the only one with this use case, so an 'official' solution would be great :)

m1k1o commented 4 years ago

I'm not sure, that full remote desktop is the main use-case of this project, but this is one solution:

3files in 1folder:

Dockerfile

FROM nurdism/neko:base

#
# install xfce4
RUN set -eux; apt-get update; \
    apt-get install -y --no-install-recommends xfce4 firefox-esr mpv qbittorrent; \
    #
    # clean up
    apt-get clean -y; \
    rm -rf /var/lib/apt/lists/* /var/cache/apt/*

#
# copy configuation files
COPY supervisord.conf /etc/neko/supervisord/xfce4.conf

supervisord.conf

[program:xfce4]
environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s",DISPLAY="%(ENV_DISPLAY)s"
command=xfce4-session
autorestart=true
priority=800
user=%(ENV_USER)s
stdout_logfile=/var/log/neko/xfce4.log
stdout_logfile_maxbytes=100MB
stdout_logfile_backups=10
redirect_stderr=true
stderr_logfile=/var/log/neko/xfce4.err.log
stderr_logfile_maxbytes=100MB
stderr_logfile_backups=10

docker-compose.yml

  neko:
    build: .
    container_name: neko
    restart: unless-stopped
    shm_size: "1gb"
    environment:
      DISPLAY: :99.0
      NEKO_BIND: :8080
    ports:
      - 8080:8080
      - "59000-59100:59000-59100/udp"

And then run like nomal neko-container:

docker-compose up -d
itskenny0 commented 4 years ago

Thank you! I did not realize you could start these from local with docker-compose.

itskenny0 commented 4 years ago

I've made a few more adjustments and pushed my version: https://github.com/itskenny0/neko-xfce4

nurdism commented 4 years ago

oh thats a neat idea, maybe I could make a nurdism/neko:xfce4 and a nurdism/neko:openbox docker image

nurdism commented 4 years ago

not live yet but its done d451173cf09d58b9b972e5e12992c4b0696b7141