-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: switch to null buildpack for performance
- Loading branch information
1 parent
81717f6
commit 008b362
Showing
9 changed files
with
102 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
https://github.com/dokku/buildpack-null.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
WAIT=2 # wait 2 seconds | ||
TIMEOUT=5 # set timeout to 5 seconds | ||
ATTEMPTS=2 # try 2 times | ||
|
||
/ python/http.server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
############################### | ||
# DEVELOPMENT # | ||
############################### | ||
|
||
# Procfile for development using the new threaded worker (scheduler, twitter stream and delayed job) | ||
cron: python3 worker.py | ||
web: python3 web.py # testing inline comment | ||
worker: python3 worker.py | ||
custom: echo -n | ||
release: touch /app/release.test | ||
|
||
|
||
# Old version with separate processes (use this if you have issues with the threaded version) | ||
# web: bundle exec rails server | ||
# schedule: bundle exec rails runner bin/schedule.rb | ||
# twitter: bundle exec rails runner bin/twitter_stream.rb | ||
# dj: bundle exec script/delayed_job run | ||
|
||
############################### | ||
# PRODUCTION # | ||
############################### | ||
|
||
# You need to copy or link config/unicorn.rb.example to config/unicorn.rb for both production versions. | ||
# Have a look at the deployment guides, if you want to set up huginn on your server: | ||
# https://github.com/cantino/huginn/doc | ||
|
||
# Using the threaded worker (consumes less RAM but can run slower) | ||
# web: bundle exec unicorn -c config/unicorn.rb | ||
# jobs: bundle exec rails runner bin/threaded.rb | ||
|
||
# Old version with separate processes (use this if you have issues with the threaded version) | ||
# web: bundle exec unicorn -c config/unicorn.rb | ||
# schedule: bundle exec rails runner bin/schedule.rb | ||
# twitter: bundle exec rails runner bin/twitter_stream.rb | ||
# dj: bundle exec script/delayed_job run | ||
|
||
############################### | ||
# Multiple DelayedJob workers # | ||
############################### | ||
# Per default Huginn can just run one agent at a time. Using a lot of agents or calling slow | ||
# external services frequently might require more DelayedJob workers (an indicator for this is | ||
# a backlog in your 'Job Management' page). | ||
# Every uncommented line starts an additional DelayedJob worker. This works for development, production | ||
# and for the threaded and separate worker processes. Keep in mind one worker needs about 300MB of RAM. | ||
# | ||
#dj2: bundle exec script/delayed_job -i 2 run | ||
#dj3: bundle exec script/delayed_job -i 3 run | ||
#dj4: bundle exec script/delayed_job -i 4 run | ||
#dj5: bundle exec script/delayed_job -i 5 run | ||
#dj6: bundle exec script/delayed_job -i 6 run | ||
#dj7: bundle exec script/delayed_job -i 7 run | ||
#dj8: bundle exec script/delayed_job -i 8 run | ||
#dj9: bundle exec script/delayed_job -i 9 run | ||
#dj10: bundle exec script/delayed_job -i 10 run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"scripts": { | ||
"dokku": { | ||
"predeploy": "touch /app/predeploy.test", | ||
"postdeploy": "touch /app/postdeploy.test" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
output="$(curl -s -S "$1")" | ||
echo "$output" | ||
test "$output" == "python/http.server" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import http.server | ||
import os | ||
|
||
|
||
class GetHandler(http.server.BaseHTTPRequestHandler): | ||
def do_GET(self): | ||
self.send_response(200) | ||
self.send_header("Content-Type", "text/plain; charset=utf-8") | ||
self.end_headers() | ||
self.wfile.write("python/http.server".encode("utf-8")) | ||
|
||
|
||
if __name__ == "__main__": | ||
port = int(os.getenv("PORT", 5000)) | ||
server = http.server.HTTPServer(("0.0.0.0", port), GetHandler) | ||
print("Listening on port {0}".format(port)) | ||
server.serve_forever() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import time | ||
|
||
|
||
def main(): | ||
print("sleeping for 60 seconds") | ||
while True: | ||
time.sleep(60) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -263,7 +263,7 @@ assert_urls() { | |
|
||
deploy_app() { | ||
declare APP_TYPE="$1" GIT_REMOTE="$2" CUSTOM_TEMPLATE="$3" CUSTOM_PATH="$4" | ||
local APP_TYPE=${APP_TYPE:="nodejs-express"} | ||
local APP_TYPE=${APP_TYPE:="python"} | ||
local GIT_REMOTE=${GIT_REMOTE:="[email protected]:$TEST_APP"} | ||
local GIT_REMOTE_BRANCH=${GIT_REMOTE_BRANCH:="master"} | ||
local TMP=${CUSTOM_TMP:=$(mktemp -d "/tmp/dokku.me.XXXXX")} | ||
|