├── Dockerfile ├── README.md ├── app.json ├── heroku.yml ├── logo-light.png ├── scripts ├── entry_point.sh ├── start-novnc.sh ├── start-vnc.sh └── start-xvfb.sh └── supervisord.conf /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:20.04 as ubuntu-base 2 | 3 | ENV DEBIAN_FRONTEND=noninteractive \ 4 | DEBCONF_NONINTERACTIVE_SEEN=true 5 | 6 | RUN apt-get -qqy update \ 7 | && apt-get -qqy --no-install-recommends install \ 8 | sudo \ 9 | supervisor \ 10 | xvfb x11vnc novnc websockify \ 11 | && apt-get autoclean \ 12 | && apt-get autoremove \ 13 | && rm -rf /var/lib/apt/lists/* /var/cache/apt/* 14 | 15 | RUN cp /usr/share/novnc/vnc.html /usr/share/novnc/index.html 16 | 17 | COPY scripts/* /opt/bin/ 18 | 19 | # Add Supervisor configuration file 20 | COPY supervisord.conf /etc/supervisor/ 21 | 22 | # Relaxing permissions for other non-sudo environments 23 | RUN mkdir -p /var/run/supervisor /var/log/supervisor \ 24 | && chmod -R 777 /opt/bin/ /var/run/supervisor /var/log/supervisor /etc/passwd \ 25 | && chgrp -R 0 /opt/bin/ /var/run/supervisor /var/log/supervisor \ 26 | && chmod -R g=u /opt/bin/ /var/run/supervisor /var/log/supervisor 27 | 28 | # Creating base directory for Xvfb 29 | RUN mkdir -p /tmp/.X11-unix && chmod 1777 /tmp/.X11-unix 30 | 31 | CMD ["/opt/bin/entry_point.sh"] 32 | 33 | #============================ 34 | # Utilities 35 | #============================ 36 | FROM ubuntu-base as ubuntu-utilities 37 | RUN apt-get update 38 | RUN apt-get install ffmpeg -y 39 | RUN apt-get -qqy update \ 40 | && apt-get -qqy --no-install-recommends install \ 41 | firefox htop terminator gnupg2 software-properties-common \ 42 | && wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \ 43 | && apt install -qqy --no-install-recommends ./google-chrome-stable_current_amd64.deb \ 44 | && apt-add-repository ppa:remmina-ppa-team/remmina-next \ 45 | && apt update \ 46 | && apt install -qqy --no-install-recommends remmina remmina-plugin-rdp remmina-plugin-secret \ 47 | && apt-add-repository ppa:obsproject/obs-studio \ 48 | && apt update \ 49 | && apt install -qqy --no-install-recommends obs-studio \ 50 | && apt install unzip \ 51 | && apt-get autoclean \ 52 | && apt-get autoremove \ 53 | && rm -rf /var/lib/apt/lists/* /var/cache/apt/* 54 | 55 | # COPY conf.d/* /etc/supervisor/conf.d/ 56 | 57 | 58 | #============================ 59 | # GUI 60 | #============================ 61 | FROM ubuntu-utilities as ubuntu-ui 62 | 63 | ENV SCREEN_WIDTH=1280 \ 64 | SCREEN_HEIGHT=720 \ 65 | SCREEN_DEPTH=24 \ 66 | SCREEN_DPI=96 \ 67 | DISPLAY=:99 \ 68 | DISPLAY_NUM=99 \ 69 | UI_COMMAND=/usr/bin/startxfce4 70 | 71 | # RUN apt-get update -qqy \ 72 | # && apt-get -qqy install \ 73 | # xserver-xorg xserver-xorg-video-fbdev xinit pciutils xinput xfonts-100dpi xfonts-75dpi xfonts-scalable kde-plasma-desktop 74 | 75 | RUN apt-get update -qqy \ 76 | && apt-get -qqy install --no-install-recommends \ 77 | dbus-x11 xfce4 \ 78 | && apt-get autoclean \ 79 | && apt-get autoremove \ 80 | && rm -rf /var/lib/apt/lists/* /var/cache/apt/* 81 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Railway VPS 2 | 3 | [![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new/template?template=https%3A%2F%2Fgithub.com%2Fkav31289%2Frailwayv) 4 | 5 | AFTER DEPLOYING YOU WILL FIND A LINK ACCESS THAT LINK TO ACCESS FREE VPS 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Youtube Stream 24/7 #techcode ", 3 | "description": "Deploy noVNC to Railway.", 4 | "keywords": [ 5 | "VNC", 6 | "Docker", 7 | "noVNC" 8 | ], 9 | "env": {}, 10 | "website": "", 11 | "repository": "https://github.com/techcode1001/railwayv.git", 12 | "logo": "https://raw.githubusercontent.com/techcode1001/railwayv/main/logo-light.png", 13 | "stack": "container" 14 | } 15 | -------------------------------------------------------------------------------- /heroku.yml: -------------------------------------------------------------------------------- 1 | build: 2 | docker: 3 | web: Dockerfile 4 | -------------------------------------------------------------------------------- /logo-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techcode1001/railwayv/aeb5563676f977d1227d95f71d1ee5873087acee/logo-light.png -------------------------------------------------------------------------------- /scripts/entry_point.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | #============================================== 4 | # OpenShift or non-sudo environments support 5 | # https://docs.openshift.com/container-platform/3.11/creating_images/guidelines.html#openshift-specific-guidelines 6 | #============================================== 7 | 8 | mkdir -p /Desktop 9 | cat << EOF > /Desktop/Chromium.desktop 10 | [Desktop Entry] 11 | Version=1.0 12 | Type=Application 13 | Name=Google Chrome 14 | Comment=Access the Internet 15 | Exec=/usr/bin/google-chrome --no-sandbox --disable-dev-shm-usage 16 | Icon=google-chrome 17 | Path= 18 | Terminal=false 19 | StartupNotify=true 20 | EOF 21 | chmod +x /Desktop/Chromium.desktop 22 | 23 | if ! whoami &> /dev/null; then 24 | if [ -w /etc/passwd ]; then 25 | echo "${USER_NAME:-ubuntu}:x:$(id -u):0:${USER_NAME:-ubuntu} user:/home/${USER_NAME:-ubuntu}:/sbin/nologin" >> /etc/passwd 26 | fi 27 | fi 28 | 29 | /usr/bin/supervisord --configuration /etc/supervisor/supervisord.conf & 30 | 31 | SUPERVISOR_PID=$! 32 | 33 | function shutdown { 34 | echo "Trapped SIGTERM/SIGINT/x so shutting down supervisord..." 35 | kill -s SIGTERM ${SUPERVISOR_PID} 36 | wait ${SUPERVISOR_PID} 37 | echo "Shutdown complete" 38 | } 39 | 40 | trap shutdown SIGTERM SIGINT 41 | wait ${SUPERVISOR_PID} -------------------------------------------------------------------------------- /scripts/start-novnc.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | websockify --web=/usr/share/novnc/ ${PORT} localhost:5900 -------------------------------------------------------------------------------- /scripts/start-vnc.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | for i in $(seq 1 10) 4 | do 5 | sleep 1 6 | xdpyinfo -display ${DISPLAY} >/dev/null 2>&1 7 | if [ $? -eq 0 ]; then 8 | break 9 | fi 10 | echo "Waiting for Xvfb..." 11 | done 12 | 13 | x11vnc -forever -shared -rfbport ${VNC_PORT:-5900} -rfbportv6 ${VNC_PORT:-5900} -display ${DISPLAY} -------------------------------------------------------------------------------- /scripts/start-xvfb.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export GEOMETRY="${SCREEN_WIDTH}""x""${SCREEN_HEIGHT}""x""${SCREEN_DEPTH}" 4 | export HOME="/" 5 | 6 | rm -f /tmp/.X*lock 7 | 8 | /usr/bin/xvfb-run --server-num=${DISPLAY_NUM} \ 9 | --listen-tcp \ 10 | --server-args="-screen 0 ${GEOMETRY} -fbdir /var/tmp -dpi ${SCREEN_DPI} -listen tcp -noreset -ac +extension RANDR" \ 11 | ${UI_COMMAND} -------------------------------------------------------------------------------- /supervisord.conf: -------------------------------------------------------------------------------- 1 | ; Documentation of this file format -> http://supervisord.org/configuration.html 2 | 3 | [supervisord] 4 | childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP) 5 | logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log) 6 | logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB) 7 | logfile_backups=10 ; (num of main logfile rotation backups;default 10) 8 | loglevel=info ; (log level;default info; others: debug,warn,trace) 9 | pidfile=/var/run/supervisor/supervisord.pid ; (supervisord pidfile;default supervisord.pid) 10 | nodaemon=true ; (start in foreground if true;default false) 11 | minfds=1024 ; (min. avail startup file descriptors;default 1024) 12 | minprocs=200 ; (min. avail process descriptors;default 200) 13 | 14 | [program:xvfb] 15 | priority=0 16 | command=/opt/bin/start-xvfb.sh 17 | autostart=true 18 | autorestart=false 19 | startsecs=0 20 | startretries=0 21 | directory=/ 22 | 23 | ;Logs 24 | redirect_stderr=false 25 | stdout_logfile=/var/log/supervisor/xvfb-stdout.log 26 | # stdout_logfile=/dev/stdout 27 | stderr_logfile=/var/log/supervisor/xvfb-stderr.log 28 | stdout_logfile_maxbytes=50MB 29 | stderr_logfile_maxbytes=50MB 30 | stdout_logfile_backups=5 31 | stderr_logfile_backups=5 32 | stdout_capture_maxbytes=50MB 33 | stderr_capture_maxbytes=50MB 34 | 35 | [program:vnc] 36 | priority=5 37 | command=/opt/bin/start-vnc.sh 38 | autostart=true 39 | autorestart=false 40 | startsecs=0 41 | startretries=0 42 | 43 | ;Logs 44 | redirect_stderr=false 45 | stdout_logfile=/var/log/supervisor/vnc-stdout.log 46 | # stdout_logfile=/dev/stdout 47 | stderr_logfile=/var/log/supervisor/vnc-stderr.log 48 | stdout_logfile_maxbytes=50MB 49 | stderr_logfile_maxbytes=50MB 50 | stdout_logfile_backups=5 51 | stderr_logfile_backups=5 52 | stdout_capture_maxbytes=50MB 53 | stderr_capture_maxbytes=50MB 54 | 55 | [program:novnc] 56 | priority=10 57 | command=/opt/bin/start-novnc.sh 58 | autostart=true 59 | autorestart=false 60 | startsecs=0 61 | startretries=0 62 | 63 | ;Logs 64 | redirect_stderr=false 65 | stdout_logfile=/var/log/supervisor/novnc-stdout.log 66 | # stdout_logfile=/dev/stdout 67 | stderr_logfile=/var/log/supervisor/novnc-stderr.log 68 | stdout_logfile_maxbytes=50MB 69 | stderr_logfile_maxbytes=50MB 70 | stdout_logfile_backups=5 71 | stderr_logfile_backups=5 72 | stdout_capture_maxbytes=50MB 73 | stderr_capture_maxbytes=50MB 74 | 75 | 76 | [include] 77 | files = /etc/supervisor/conf.d/*.conf --------------------------------------------------------------------------------