Skip to content

Instantly share code, notes, and snippets.

@Helkyd
Forked from revant/Procfile
Created July 18, 2021 00:42
Show Gist options
  • Save Helkyd/f98a8ab6121ac0bcee025e3b73508ed8 to your computer and use it in GitHub Desktop.
Save Helkyd/f98a8ab6121ac0bcee025e3b73508ed8 to your computer and use it in GitHub Desktop.

Revisions

  1. @revant revant revised this gist Mar 26, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion nginx.conf
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    upstream frappe-bench-custom-node {
    server 127.0.0.1:4200 fail_timeout=0;
    server 0.0.0.0:4200 fail_timeout=0;
    }

    server {
  2. @revant revant revised this gist Nov 5, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion nginx.conf
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    upstream frappe-bench-custom-node {
    server 127.0.0.1:1337 fail_timeout=0;
    server 127.0.0.1:4200 fail_timeout=0;
    }

    server {
  3. @revant revant revised this gist Aug 14, 2017. 1 changed file with 17 additions and 0 deletions.
    17 changes: 17 additions & 0 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    upstream frappe-bench-custom-node {
    server 127.0.0.1:1337 fail_timeout=0;
    }

    server {
    ...
    location /custom-node {
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header X-Frappe-Site-Name test_rn;
    proxy_set_header Origin $scheme://$http_host;
    proxy_set_header Host $host;
    proxy_pass http://frappe-bench-custom-node;
    }
    ...
    }
  4. @revant revant revised this gist Aug 11, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion supervisor.conf
    Original file line number Diff line number Diff line change
    @@ -13,4 +13,4 @@ user=revant
    directory=/home/revant/frappe-bench

    [group:frappe-bench-extras]
    programs=frappe-bench-hyper-track
    programs=frappe-bench-custom-app
  5. @revant revant created this gist Aug 11, 2017.
    12 changes: 12 additions & 0 deletions Procfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    redis_cache: redis-server config/redis_cache.conf
    redis_socketio: redis-server config/redis_socketio.conf
    redis_queue: redis-server config/redis_queue.conf
    web: bench serve --port 8000

    socketio: /usr/bin/node apps/frappe/socketio.js
    custom_app: /usr/bin/node apps/custom_app/custom_node.js
    watch: bench watch
    schedule: bench schedule
    worker_short: bench worker --queue short
    worker_long: bench worker --queue long
    worker_default: bench worker --queue default
    18 changes: 18 additions & 0 deletions custom_node.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    // content of custom_node.js
    const http = require('http')
    const port = 4200

    const requestHandler = (request, response) => {
    console.log(request.url)
    response.end('Hello Node.js Server!')
    }

    const server = http.createServer(requestHandler)

    server.listen(port, (err) => {
    if (err) {
    return console.log('something bad happened', err)
    }

    console.log(`server is listening on ${port}`)
    })
    16 changes: 16 additions & 0 deletions supervisor.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    ; Notes:
    ; priority=1 --> Lower priorities indicate programs that start first and shut down last
    ; killasgroup=true --> send kill signal to child processes too

    [program:frappe-bench-custom-app]
    command=/usr/bin/node /home/revant/frappe-bench/apps/custom_app/custom_node.js
    priority=4
    autostart=true
    autorestart=true
    stdout_logfile=/home/revant/frappe-bench/logs/custom-app.log
    stderr_logfile=/home/revant/frappe-bench/logs/custom-app.error.log
    user=revant
    directory=/home/revant/frappe-bench

    [group:frappe-bench-extras]
    programs=frappe-bench-hyper-track