What's new
PGBlitz.com

Register Now! Find useful tips, Interact /w Community Members and join the part the Best Community on the Internet!

Having a second instance of a pg community app, possible?

Cyb3rGh05t

Senior Member
Hey,

is there a way to have 2 instances of the same pg app with different ports running in docker ?
If yes, how can i get this to work?

I want to add a second instance of jdownloader2 in plexguide?

thanks :)
 

Cyb3rGh05t

Senior Member
Thanks for the reply,
Yes i did this, i made a custom container, i deploy the app and it is showing up in portainer as running but the app doesnt start in log files.

See here:

Code:
Actions   
      
[nginx] starting...


[services.d] starting openbox...


[openbox] starting...


[x11vnc] starting...


01/05/2019 14:54:38 passing arg to libvncserver: -rfbport


01/05/2019 14:54:38 passing arg to libvncserver: 5900


01/05/2019 14:54:38 passing arg to libvncserver: -rfbportv6


01/05/2019 14:54:38 passing arg to libvncserver: -1


01/05/2019 14:54:38 passing arg to libvncserver: -httpportv6


01/05/2019 14:54:38 passing arg to libvncserver: -1


01/05/2019 14:54:38 passing arg to libvncserver: -desktop


01/05/2019 14:54:38 passing arg to libvncserver: JDownloader 2


01/05/2019 14:54:38 x11vnc version: 0.9.14 lastmod: 2015-11-14  pid: 761


01/05/2019 14:54:38 Using X display :0


01/05/2019 14:54:38 rootwin: 0x43 reswin: 0x200001 dpy: 0xf0d989e0


01/05/2019 14:54:38


01/05/2019 14:54:38 ------------------ USEFUL INFORMATION ------------------


01/05/2019 14:54:38 X DAMAGE available on display, using it for polling hints.


01/05/2019 14:54:38   To disable this behavior use: '-noxdamage'


01/05/2019 14:54:38


01/05/2019 14:54:38   Most compositing window managers like 'compiz' or 'beryl'


01/05/2019 14:54:38   cause X DAMAGE to fail, and so you may not see any screen


01/05/2019 14:54:38   updates via VNC.  Either disable 'compiz' (recommended) or


01/05/2019 14:54:38   supply the x11vnc '-noxdamage' command line option.


01/05/2019 14:54:38 X COMPOSITE available on display, using it for window polling.


01/05/2019 14:54:38   To disable this behavior use: '-noxcomposite'


01/05/2019 14:54:38


01/05/2019 14:54:38 Wireframing: -wireframe mode is in effect for window moves.


01/05/2019 14:54:38   If this yields undesired behavior (poor response, painting


01/05/2019 14:54:38   errors, etc) it may be disabled:


01/05/2019 14:54:38    - use '-nowf' to disable wireframing completely.


01/05/2019 14:54:38    - use '-nowcr' to disable the Copy Rectangle after the


01/05/2019 14:54:38      moved window is released in the new position.


01/05/2019 14:54:38   Also see the -help entry for tuning parameters.


01/05/2019 14:54:38   You can press 3 Alt_L's (Left "Alt" key) in a row to


01/05/2019 14:54:38   repaint the screen, also see the -fixscreen option for


01/05/2019 14:54:38   periodic repaints.


01/05/2019 14:54:38 GrabServer control via XTEST.


01/05/2019 14:54:38


01/05/2019 14:54:38 Scroll Detection: -scrollcopyrect mode is in effect to


01/05/2019 14:54:38   use RECORD extension to try to detect scrolling windows


01/05/2019 14:54:38   (induced by either user keystroke or mouse input).


01/05/2019 14:54:38   If this yields undesired behavior (poor response, painting


01/05/2019 14:54:38   errors, etc) it may be disabled via: '-noscr'


01/05/2019 14:54:38   Also see the -help entry for tuning parameters.


01/05/2019 14:54:38   You can press 3 Alt_L's (Left "Alt" key) in a row to


01/05/2019 14:54:38   repaint the screen, also see the -fixscreen option for


01/05/2019 14:54:38   periodic repaints.


01/05/2019 14:54:38


01/05/2019 14:54:38 XKEYBOARD: number of keysyms per keycode 7 is greater


01/05/2019 14:54:38   than 4 and 51 keysyms are mapped above 4.


01/05/2019 14:54:38   Automatically switching to -xkb mode.


01/05/2019 14:54:38   If this makes the key mapping worse you can


01/05/2019 14:54:38   disable it with the "-noxkb" option.


01/05/2019 14:54:38   Also, remember "-remap DEAD" for accenting characters.


01/05/2019 14:54:38


01/05/2019 14:54:38 X FBPM extension not supported.


Xlib:  extension "DPMS" missing on display ":0".


01/05/2019 14:54:38 X display is not capable of DPMS.


01/05/2019 14:54:38 --------------------------------------------------------


01/05/2019 14:54:38


01/05/2019 14:54:38 Default visual ID: 0x21


01/05/2019 14:54:38 Read initial data from X display into framebuffer.


01/05/2019 14:54:38 initialize_screen: fb_depth/fb_bpp/fb_Bpl 24/32/5120


01/05/2019 14:54:38


01/05/2019 14:54:38 X display :0 is 32bpp depth=24 true color


01/05/2019 14:54:38


01/05/2019 14:54:38 Listening for VNC connections on TCP port 5900


01/05/2019 14:54:38


01/05/2019 14:54:38 Xinerama is present and active (e.g. multi-head).


01/05/2019 14:54:38 Xinerama: number of sub-screens: 1


01/05/2019 14:54:38 Xinerama: no blackouts needed (only one sub-screen)


01/05/2019 14:54:38


01/05/2019 14:54:38 fb read rate: 807 MB/sec


01/05/2019 14:54:38 fast read: reset -wait  ms to: 10


01/05/2019 14:54:38 fast read: reset -defer ms to: 10


01/05/2019 14:54:38 The X server says there are 10 mouse buttons.


01/05/2019 14:54:38 screen setup finished.


01/05/2019 14:54:38




The VNC desktop is:      7216b93692f8:0




0




******************************************************************************


Have you tried the x11vnc '-ncache' VNC client-side pixel caching feature yet?




The scheme stores pixel data offscreen on the VNC viewer side for faster


retrieval.  It should work with any VNC viewer.  Try it by running:




    x11vnc -ncache 10 ...




One can also add -ncache_cr for smooth 'copyrect' window motion.


More info: http://www.karlrunge.com/x11vnc/faq.html#faq-client-caching




[services.d] starting statusmonitor...


[statusmonitor] no file to monitor: disabling service...


[services.d] starting app...


[app] starting JDownloader 2...


[services.d] done.


[jdsupervisor] JDownloader2 not started yet.  Proceeding...
it stays at 'Proceeding.....'


here is my .yml

Code:
#!/bin/bash
#
# Title:      Jdownloader2 for PGBlitz (OAuth security)
# Author(s):  timekills
# URL:        https://pgblitz.com - https://github.com/timekills/jdownloader2-for-Plexguide
# GNU:        General Public License v3.0
################################################################################
---
- hosts: localhost
  gather_facts: false
  tasks:
    # FACTS #######################################################################

    - name: 'Set Known Facts'
      set_fact:
        pgrole: 'jdownloader2-movies'
        intport: '5850'
        extport: '5852'
        intport2: '5952'
        extport2: '5952'
        intport3: '3139'
        extport3: '3139'
        image: 'jlesage/jdownloader-2'

    # CORE (MANDATORY) ############################################################
    - name: 'Including cron job'
      include_tasks: '/opt/communityapps/apps/_core.yml'

    - name: 'Including plugins'
      include_tasks: '/opt/communityapps/apps/_plugins.yml'

    - name: 'Including folders'
      include_tasks: '/opt/communityapps/apps/_downloaders.yml'

    - name: 'Ini Check'
      stat:
        path: /opt/appdata/{{pgrole}}/core.conf
      register: inicheck

    # LABELS ######################################################################
    - name: 'Adding Traefik'
      set_fact:
        pg_labels:
          traefik.enable: 'true'
          traefik.port: '{{intport}}'
          traefik.frontend.auth.forward.address: '{{gauth}}'
          traefik.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}'
          
    - name: 'Setting PG Volumes'
      set_fact:
        pg_volumes:
          - '/opt/appdata/{{pgrole}}:/config'
          - '{{path.stdout}}:{{path.stdout}}'
          - '/mnt/unionfs:/unionfs'
          - '/mnt:/mnt'
          - '{{path.stdout}}/downloads/jdownloader2/movies/:/output:rw'
          - '/etc/localtime:/etc/localtime:ro'

    - name: 'Setting PG ENV'
      set_fact:
        pg_env:
          UID: '1000'
          GID: '1000'

    # MAIN DEPLOYMENT #############################################################
    - name: 'Deploying {{pgrole}}'
      docker_container:
        name: '{{pgrole}}'
        image: '{{image}}'
        pull: yes
        published_ports:
          - '{{ports.stdout}}{{extport}}:{{intport}}'
        volumes: '{{pg_volumes}}'
        env: '{{pg_env}}'
        restart_policy: unless-stopped
        networks:
          - name: plexguide
            aliases:
              - '{{pgrole}}'
        state: started
        labels: '{{pg_labels}}'
i dont know what i did wrong?

thanks
 

Cyb3rGh05t

Senior Member
@MrDoob i changed the intern port to 5800 an leaved the extern port at 5852
but i get still the same state in portainer and a bad gateway in nginx.

Could it be something else that i am missing?

thanks
 
M

MrDoob

Guest
Remove the defect app first then deploy it.

Also remove the folder from the defect app.
 
M

MrDoob

Guest
Try this one


Bash:
#!/bin/bash
#
# Title:      Jdownloader2 for PGBlitz (OAuth security)
# Author(s):  timekills
# URL:        https://pgblitz.com - https://github.com/timekills/jdownloader2-for-Plexguide
# GNU:        General Public License v3.0
################################################################################
---
- hosts: localhost
  gather_facts: false
  tasks:
    # FACTS #######################################################################

    - name: 'Set Known Facts'
      set_fact:
        pgrole: 'jdmovies'
        intport: '5800'
        extport: '5803'
        intport2: '5902'
        extport2: '5903'
        intport3: '3129'
        extport3: '3130'
        image: 'jlesage/jdownloader-2'

    # CORE (MANDATORY) ############################################################
    - name: 'Including cron job'
      include_tasks: '/opt/communityapps/apps/_core.yml'

    - name: 'Including plugins'
      include_tasks: '/opt/communityapps/apps/_plugins.yml'

    - name: 'Including folders'
      include_tasks: '/opt/communityapps/apps/_downloaders.yml'

    - name: 'Ini Check'
      stat:
        path: /opt/appdata/{{pgrole}}/core.conf
      register: inicheck

    # LABELS ######################################################################
    - name: 'Adding Traefik'
      set_fact:
        pg_labels:
          traefik.enable: 'true'
          traefik.port: '{{intport}}'
          traefik.frontend.auth.forward.address: '{{gauth}}'
          traefik.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}'
        
    - name: 'Setting PG Volumes'
      set_fact:
        pg_volumes:
          - '/opt/appdata/{{pgrole}}:/config'
          - '{{path.stdout}}:{{path.stdout}}'
          - '/mnt/unionfs:/unionfs'
          - '/mnt:/mnt'
          - '{{path.stdout}}/downloads/{{pgrole}}/:/output:rw'
          - '/etc/localtime:/etc/localtime:ro'

    - name: 'Setting PG ENV'
      set_fact:
        pg_env:
          UID: '1000'
          GID: '1000'

    # MAIN DEPLOYMENT #############################################################
    - name: 'Deploying {{pgrole}}'
      docker_container:
        name: '{{pgrole}}'
        image: '{{image}}'
        pull: yes
        published_ports:
          - '{{ports.stdout}}{{extport}}:{{intport}}'
        volumes: '{{pg_volumes}}'
        env: '{{pg_env}}'
        restart_policy: unless-stopped
        networks:
          - name: plexguide
            aliases:
              - '{{pgrole}}'
        state: started
        labels: '{{pg_labels}}'
 

Cyb3rGh05t

Senior Member
Try this one


Bash:
#!/bin/bash
#
# Title:      Jdownloader2 for PGBlitz (OAuth security)
# Author(s):  timekills
# URL:        https://pgblitz.com - https://github.com/timekills/jdownloader2-for-Plexguide
# GNU:        General Public License v3.0
################################################################################
---
- hosts: localhost
  gather_facts: false
  tasks:
    # FACTS #######################################################################

    - name: 'Set Known Facts'
      set_fact:
        pgrole: 'jdmovies'
        intport: '5800'
        extport: '5803'
        intport2: '5902'
        extport2: '5903'
        intport3: '3129'
        extport3: '3130'
        image: 'jlesage/jdownloader-2'

    # CORE (MANDATORY) ############################################################
    - name: 'Including cron job'
      include_tasks: '/opt/communityapps/apps/_core.yml'

    - name: 'Including plugins'
      include_tasks: '/opt/communityapps/apps/_plugins.yml'

    - name: 'Including folders'
      include_tasks: '/opt/communityapps/apps/_downloaders.yml'

    - name: 'Ini Check'
      stat:
        path: /opt/appdata/{{pgrole}}/core.conf
      register: inicheck

    # LABELS ######################################################################
    - name: 'Adding Traefik'
      set_fact:
        pg_labels:
          traefik.enable: 'true'
          traefik.port: '{{intport}}'
          traefik.frontend.auth.forward.address: '{{gauth}}'
          traefik.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}'
       
    - name: 'Setting PG Volumes'
      set_fact:
        pg_volumes:
          - '/opt/appdata/{{pgrole}}:/config'
          - '{{path.stdout}}:{{path.stdout}}'
          - '/mnt/unionfs:/unionfs'
          - '/mnt:/mnt'
          - '{{path.stdout}}/downloads/{{pgrole}}/:/output:rw'
          - '/etc/localtime:/etc/localtime:ro'

    - name: 'Setting PG ENV'
      set_fact:
        pg_env:
          UID: '1000'
          GID: '1000'

    # MAIN DEPLOYMENT #############################################################
    - name: 'Deploying {{pgrole}}'
      docker_container:
        name: '{{pgrole}}'
        image: '{{image}}'
        pull: yes
        published_ports:
          - '{{ports.stdout}}{{extport}}:{{intport}}'
        volumes: '{{pg_volumes}}'
        env: '{{pg_env}}'
        restart_policy: unless-stopped
        networks:
          - name: plexguide
            aliases:
              - '{{pgrole}}'
        state: started
        labels: '{{pg_labels}}'
THANKS @MrDoob

you mean the folders in /opt/appdata/ and /mnt/downloads?
 

Cyb3rGh05t

Senior Member
hi, @MrDoob

is it possible to change the inport: 5800?

i have to instances of jdownloader2 (one for movies and one for shows) but i cant work simultaneously with both instances.
I have to wait till one instance to finish before i can call the second one..

there are a lot of apps in the core box that uses the inport: 5800.

Is there any chance i can change them without screwing up somthing?

THANK YOU
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.


Development Donations

 

Top NZB NewsGroups!

Members - Up To a 58% Discount!

Trending

Online statistics

Members online
5
Guests online
88
Total visitors
93
Top