Compare commits

...

532 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
bdd2b4bfe5 Release 0.6.2 2016-06-20 21:16:21 -04:00
Jose Diaz-Gonzalez
ecd47dcdeb Merge pull request #2259 from andrewsomething/installer-fix
Don't run DeleteInstallerThread() until after set_debconf_selection
2016-06-20 20:21:23 -04:00
Andrew Starr-Bochicchio
3762b7b9f9 Don't run DeleteInstallerThread() until after set_debconf_selection calls. 2016-06-20 19:59:19 -04:00
Jose Diaz-Gonzalez
a79cd7aebf Merge pull request #2256 from dokku/2254_mh-remove-storage-mount-on-build
Revert automatically binding storage mounts in build phase
2016-06-20 14:50:02 -04:00
Michael Hobbs
aa345fad01 revert automatically binding storage mounts in build phase. closes #2254 2016-06-20 11:39:08 -07:00
Jose Diaz-Gonzalez
ed06b8961e Release 0.6.1 2016-06-18 23:54:00 -04:00
Michael Hobbs
8e2a3783ce Merge pull request #2250 from dokku/mh-fix-nginx-template-context-variable
fix missing $ sign in default nginx template
2016-06-18 16:12:29 -07:00
Michael Hobbs
d9ab4d1424 fix missing $ sign in default nginx template 2016-06-18 16:06:46 -07:00
Jose Diaz-Gonzalez
833db67f25 Release 0.6.0 2016-06-18 01:53:48 -04:00
Jose Diaz-Gonzalez
01f370ab82 Add docs for new repository-related tags
Closes #2249

[ci skip]
2016-06-18 01:31:51 -04:00
Michael Hobbs
9d4a288579 Merge pull request #2242 from dokku/2166-avoid-calling-dokku
Avoid calling dokku binary
2016-06-17 20:24:22 -07:00
Jose Diaz-Gonzalez
b6f9672d40 Add note to plugin creation regarding calling the binary directly
[ci skip]
2016-06-17 23:12:11 -04:00
Jose Diaz-Gonzalez
8f8ee9c5da Add a section on how calling the dokku binary should work
[ci skip]
2016-06-17 23:00:43 -04:00
Michael Hobbs
9effe275bd don't call dokku binary in checks/install. fix variable typo 2016-06-17 19:49:15 -07:00
Michael Hobbs
c1ae280a78 [ci skip] clarify triggers being called by internal functions 2016-06-17 19:30:25 -07:00
Michael Hobbs
ce3aa4b93e remove calls to dokku binary for build/receive/release 2016-06-17 16:40:35 -07:00
Michael Hobbs
fcefd4a29b use central deploy lock in git plugin 2016-06-17 16:16:20 -07:00
Michael Hobbs
4f8c1b64c9 implement central deploy lock and use in tar plugin 2016-06-17 15:58:31 -07:00
Michael Hobbs
2ece0e1bf8 move DOKKU_NGINX_SSL_PORT setting to correct logic block 2016-06-17 15:25:09 -07:00
Jose Diaz-Gonzalez
1216a5e65a Remove use of dokku binary from tar plugin 2016-06-17 13:55:43 -07:00
Jose Diaz-Gonzalez
aca2540651 Move tar functions into sourceable functions file 2016-06-17 13:55:43 -07:00
Jose Diaz-Gonzalez
2cb20f3fd0 Remove use of dokku binary from git plugin 2016-06-17 13:55:43 -07:00
Jose Diaz-Gonzalez
946756bd43 Move git functions into sourceable functions file 2016-06-17 13:55:43 -07:00
Michael Hobbs
d74006b51a Merge pull request #2248 from dokku/2239_mh-proxy-ports
proxy port mapping
2016-06-16 19:48:45 -07:00
Michael Hobbs
e6dfdc0732 fix reference to .SPDY_SUPPORTED in default template 2016-06-16 17:23:35 -07:00
Michael Hobbs
21d0859253 make proxy port listing a callable function 2016-06-16 16:04:44 -07:00
Michael Hobbs
2b19881f01 [ci skip] port mapping docs 2016-06-16 16:04:44 -07:00
Michael Hobbs
39375342e0 add port mapping tests 2016-06-16 16:04:44 -07:00
Michael Hobbs
ab94a9fc67 fix broken tar/urls tests 2016-06-16 16:04:44 -07:00
Michael Hobbs
ff18e0d6be cleanup external references to nginx-vhosts plugin 2016-06-16 16:04:44 -07:00
Michael Hobbs
6c1d6225f9 initial pass at implementing DOKKU_PROXY_PORT_MAP. closes #2239. 2016-06-16 16:04:44 -07:00
Michael Hobbs
99c56ccd6d Merge pull request #2243 from dokku/nginx-fixes
Nginx 1.9.5+ support
2016-06-16 16:02:02 -07:00
Jose Diaz-Gonzalez
f99aa2b128 Skip upgrading nginx when the version of nginx is at least 1.8.0
Refs #2059
2016-06-16 17:18:47 -04:00
Jose Diaz-Gonzalez
a43fc39d9a Support nginx 1.9.5+
Newer versions of nginx drop spdy support in favor of http2, and thus the nginx config that we bundle with dokku causes nginx to fail to reload in certain cases. This change drops spdy support in favor of http2 for versions of nginx greater than 1.9.5.

Closes #2216
2016-06-16 17:18:43 -04:00
Michael Hobbs
6be1fd33cd Merge pull request #2241 from dokku/2146-debconf-set-selections
Set debconf selections from dokku-installer.py. Closes #2146
2016-06-16 12:47:09 -07:00
Michael Hobbs
5e9df3a92d Merge pull request #2168 from dokku/2073_mh-zero-downtime
allow zero-downtime to be completely disabled.
2016-06-16 12:46:30 -07:00
Michael Hobbs
5c741696fc Merge pull request #2109 from dokku/modify-deployed-image
Allow user to modify the repository and tag when deploying an app
2016-06-16 12:43:11 -07:00
Michael Hobbs
8e30722c1e Merge pull request #2050 from dokku/1570-repo-plugin
Implement repo:gc and repo:purge-cache
2016-06-16 12:42:25 -07:00
Michael Hobbs
cd48505922 Merge pull request #2018 from pascalw/feature/dokku-run-from-procfile
Support running Procfile commands using `dokku run`
2016-06-16 12:42:01 -07:00
Jose Diaz-Gonzalez
24cab65d9c Make opencollective badges flat-square
Also move gratipay to same line

[ci skip]
2016-06-15 14:24:01 -04:00
Michael Hobbs
dc8acc0da6 Merge pull request #2209 from piamancini/patch-1
Added backers and sponsors from OpenCollective
2016-06-15 10:42:58 -07:00
Michael Hobbs
0297dd9e1f Merge pull request #2244 from basgys/master
Add InfluxDB to plugins
2016-06-13 07:26:51 -07:00
Bastien
e4268148cf Add InfluxDB to plugins 2016-06-13 09:51:08 +02:00
Jose Diaz-Gonzalez
f226dc7c27 Set debconf selections from dokku-installer.py. Closes #2146 2016-06-12 15:07:42 -04:00
Jose Diaz-Gonzalez
b71c5b668f Release 0.5.8 2016-06-10 22:40:57 -04:00
Michael Hobbs
30ae651a59 Merge pull request #2238 from dokku/2207_mh-storage-on-build
mount storage mounts on build and filter for dockerfile apps
2016-06-10 15:33:45 -07:00
Jose Diaz-Gonzalez
d2ee0994c0 Merge pull request #2233 from dokku/lintian-cleanup
Lintian cleanup
2016-06-10 17:09:55 -04:00
Michael Hobbs
1e5a8b146c Merge pull request #2237 from dokku/2231_mh-reject-invalid-domains
reject invalid domains in domains:add
2016-06-10 13:56:39 -07:00
Michael Hobbs
6bf9ef0aa5 mount storage mounts on build and filter for dockerfile apps. closes #2207 2016-06-10 13:50:53 -07:00
Michael Hobbs
100afca1ca Merge pull request #2236 from dokku/2235_mh-hide-img-check-err-output
no need to show output from is_image_herokuish_based()
2016-06-10 13:18:08 -07:00
Michael Hobbs
9a29cc59a8 reject invalid domains in domains:add. closes #2231 2016-06-10 13:10:11 -07:00
Michael Hobbs
6c08b9b343 no need to show output from is_image_herokuish_based(). closes #2235 2016-06-10 12:31:25 -07:00
Michael Hobbs
48965e05bd add tests for repo commands 2016-06-09 20:05:19 -07:00
Jose Diaz-Gonzalez
2c1f32199a Implement repo:gc and repo:purge-cache
These are helper plugins that mimic the repo plugin: https://github.com/heroku/heroku-repo

The following commands will remain unimplemented:

- `clone`: not useful for the host client to clone
- `download`: currently not possible for us to "host" a tarball of the repo
- `reset`: we still store files in the repo (though we shouldn't) so we cannot easily reinitialize the repository.

Also fixes a potential race condition if two separate processes create an application's `$CACHE_DIR`.

Closes #1570
2016-06-09 20:05:19 -07:00
Michael Hobbs
1e0c585b74 allow zero-downtime to be completely disabled. closes #2073. closes #2125 2016-06-09 18:37:31 -07:00
Michael Hobbs
0c58aeaa52 Merge pull request #2234 from dokku/2230_mh-fix-container-rename-on-remove-proctype
cleanup container state files when proc type is removed from app
2016-06-09 17:56:54 -07:00
Michael Hobbs
2cedc19b2a cleanup container state files when proc type is removed from app. closes #2230 2016-06-09 17:03:36 -07:00
Jose Diaz-Gonzalez
9bb554e5bc Run lintian on all built packages 2016-06-09 15:07:31 -04:00
Jose Diaz-Gonzalez
4aab4dcfcf Allow building non-release (patch) packages for dokku 2016-06-09 15:07:13 -04:00
Jose Diaz-Gonzalez
d4660d9fe9 Skip moving the deb to the correct place by building to /tmp 2016-06-09 14:54:19 -04:00
Jose Diaz-Gonzalez
9a7d4fb402 Call deb-setup once to speed up build process 2016-06-09 14:37:15 -04:00
Jose Diaz-Gonzalez
d302316549 sort mkdir calls 2016-06-09 14:33:13 -04:00
Jose Diaz-Gonzalez
327db3d07a Add build-essential requirement 2016-06-09 14:32:58 -04:00
Jose Diaz-Gonzalez
1cba46f3a1 Do not grep a non-existent file 2016-06-09 14:29:50 -04:00
Jose Diaz-Gonzalez
54c5d0dfa6 ensure help2man exists before running addman 2016-06-09 14:29:21 -04:00
Jose Diaz-Gonzalez
ef59ff38f6 Ignore chown failures
This can occur in build environments where there is no dokku user
2016-06-09 14:29:06 -04:00
Jose Diaz-Gonzalez
683113ef78 Update doc reference to dokku binary 2016-06-09 14:28:35 -04:00
Jose Diaz-Gonzalez
79a7342808 Check that the confmodule is sourceable before sourcing it 2016-06-09 12:48:54 -04:00
Jose Diaz-Gonzalez
eab69bd6d5 Create a lintian-overrides file so that we can pass lintian during testing 2016-06-09 12:41:36 -04:00
Jose Diaz-Gonzalez
b1deb45c81 Rewrite sshcommand calls to take into account potential locations of sshcommand 2016-06-09 12:40:01 -04:00
Michael Hobbs
5ff73995f2 Merge pull request #2229 from vshn/fix_slash_domain_removal
Fix removal of domains with schema
2016-06-08 12:44:47 -07:00
Michael Hanselmann
e0f6435d86 Fix removal of domains with schema
In at least one case a customer of ours added a domain including
a schema, as in “http://domain.tld/”. That is obviously incorrect, but
then they couldn't remove it using the dokku command:

  $ dokku domains:remove app7 http://domain.tld/
  sed: -e expression #1, char 9: unknown command: `/'

This patch changes the sed command to use the "\CregexpC" syntax. The
character used is a vertical pipe, which is far less likely to be used
in a URL. After the change:

  $ dokku domains:remove app7 http://domain.tld/
  -----> Removed http://domain.tld/ from app7

Signed-off-by: Michael Hanselmann <hansmi@vshn.ch>
2016-06-08 11:34:30 +02:00
Michael Hobbs
2565ea1543 Merge pull request #2228 from dokku/mh-copy-scale-file-from-workdir
support WORKDIR location for DOKKU_SCALE
2016-06-06 18:26:05 -07:00
Michael Hobbs
cb8a9648c9 support WORKDIR location for DOKKU_SCALE. refs #2226 2016-06-06 17:45:33 -07:00
Michael Hobbs
17f7708226 Merge pull request #2227 from dokku/2226_mh-extract-procfile-with-tags
pass image tag from release_and_deploy down through extract_procfile
2016-06-06 16:55:38 -07:00
Michael Hobbs
166f7f38e4 pass image tag from release_and_deploy down through extract_procfile. closed #2226 2016-06-06 11:31:59 -07:00
Michael Hobbs
74e861417e Merge pull request #2220 from dokku/josegonzalez-patch-1
remove DOKKU_PROCFILE before attempting to extract it
2016-06-03 10:16:52 -07:00
Jose Diaz-Gonzalez
0487083f37 Merge pull request #2223 from dokku/jg-nginx-vhosts
De-duplicate nginx restarting
2016-06-03 12:49:58 -04:00
Jose Diaz-Gonzalez
3c6982a942 De-duplicate restart_nginx in post-delete hook 2016-06-03 03:19:26 -04:00
Michael Hobbs
6760a2d143 Merge pull request #2222 from dokku/mh-reorder-nginx-blocks-in-docs
move nginx upstream blocks to the bottom in docs examples
2016-06-02 13:01:25 -07:00
Michael Hobbs
a9fd2cdbf6 [ci skip] move nginx upstream blocks to the bottom in docs examples 2016-06-02 13:00:39 -07:00
Jose Diaz-Gonzalez
377412f9f8 remove DOKKU_PROCFILE before attempting to extract it 2016-05-31 17:02:25 -04:00
Michael Hobbs
848f92ef7f Merge pull request #2214 from dokku/2210_mh-client-remove-git-push
remove git push from client
2016-05-26 18:04:16 -07:00
Michael Hobbs
8bbb210a10 remove git push from client. closes #2210 2016-05-26 15:32:41 -07:00
Jose Diaz-Gonzalez
401a42f5c4 Merge pull request #2212 from jbothma/unsafe-installer-docs
Warn and instruct users about unsafe publicly-accessible web installer
2016-05-25 11:41:09 -04:00
JD Bothma
5a99b8f0ed Warn and instruct users about unsafe publicly-accessible web installer
Addresses #2211
2016-05-25 14:07:48 +02:00
Pia Mancini
346efbfdd8 removed plus signs 2016-05-23 15:27:45 -07:00
Pia Mancini
498f0eda22 Added backers and sponsors from OpenCollective
Now, your backers & sponsors from open collective will appear automatically here.
2016-05-23 14:58:14 -07:00
Jose Diaz-Gonzalez
c268432bc3 Merge pull request #2205 from dokku/fix-lintian-errors
Fix lintian errors
2016-05-18 16:52:28 -04:00
Jose Diaz-Gonzalez
a833688355 Allow users to override their server_names_hash_bucket_size 2016-05-18 14:45:11 -04:00
Jose Diaz-Gonzalez
4917330b79 Make bash files executable 2016-05-18 14:12:40 -04:00
Jose Diaz-Gonzalez
4d91b2085e Add extended description to dokku package 2016-05-18 14:11:06 -04:00
Jose Diaz-Gonzalez
29c69f9f86 Move dokku binary to /usr/bin from /usr/local/bin 2016-05-18 14:10:45 -04:00
Jose Diaz-Gonzalez
476429a7db Remove stray DS_Store files from package 2016-05-18 14:10:27 -04:00
Jose Diaz-Gonzalez
2d045d1ae1 Update sponsor references 2016-05-18 14:03:11 -04:00
Jose Diaz-Gonzalez
9bd0c69dac Do not peg nginx to a specific version 2016-05-18 13:56:09 -04:00
Jose Diaz-Gonzalez
b232f7cd49 Fix description lintian issue in plugn, sshcommand and sigil 2016-05-18 13:53:30 -04:00
Jose Diaz-Gonzalez
904dfb64aa Pass more lintian rules in sshcommand package 2016-05-18 13:42:47 -04:00
Jose Diaz-Gonzalez
a5ef53f2f5 Pass more lintian rules in plugn package 2016-05-18 13:37:23 -04:00
Jose Diaz-Gonzalez
88db4daa62 Install lintian so built packages can be linted 2016-05-18 13:28:33 -04:00
Jose Diaz-Gonzalez
56dde3ff31 Rename sigil package to gliderlabs-sigl
Also fix a few lintian issues
2016-05-18 13:28:02 -04:00
Jose Diaz-Gonzalez
2da58ff351 Release 0.5.7 2016-05-17 03:15:27 -04:00
Jose Diaz-Gonzalez
af48605054 Merge pull request #2203 from dokku/josegonzalez-patch-1
Allow specifying NO_INSTALL_RECOMMENDS in bootstrapped installs
2016-05-17 03:02:45 -04:00
Jose Diaz-Gonzalez
66790e3d82 Allow specifying NO_INSTALL_RECOMMENDS in bootstrapped installs
[ci skip]
2016-05-17 03:02:17 -04:00
Michael Hobbs
2c201a7d6f Merge pull request #2202 from dokku/2197_mh-nginx-install
attempt to bypass inconsistencies in nginx start behavior
2016-05-16 14:57:44 -07:00
Michael Hobbs
78d2b3e7d2 attempt to bypass inconsistencies in nginx start behavior. closes #2197 2016-05-16 13:29:16 -07:00
Jose Diaz-Gonzalez
9b60f0c3c6 Merge pull request #2195 from dokku/2179-clarify-triggers
Clarify when certain plugin triggers are invoked.
2016-05-14 15:05:08 -04:00
Jose Diaz-Gonzalez
668437a9e5 Clarify when certain plugin triggers are invoked.
Closes #2179

[ci skip]
2016-05-14 15:04:47 -04:00
Jose Diaz-Gonzalez
5f30115796 Merge pull request #2194 from dokku/2158-procfile-docs
Clarify the role of process types for buildpack deployment
2016-05-14 14:54:11 -04:00
Jose Diaz-Gonzalez
5c6e39d2c0 Clarify the role of process types for buildpack deployment
Closes #2158

[ci skip]
2016-05-14 14:53:46 -04:00
Jose Diaz-Gonzalez
6a9d9f212f Merge pull request #2193 from dokku/deb-upgrade-herokuish
Upgrade herokuish version built via deb packaging
2016-05-14 14:39:29 -04:00
Jose Diaz-Gonzalez
599bd59c6f Upgrade herokuish version built via deb packaging
[ci skip]
2016-05-14 14:38:51 -04:00
Jose Diaz-Gonzalez
e4dd40bbcc Merge pull request #2192 from dokku/2186-checks-web
Clarify that the checks are only run against the web process
2016-05-14 14:37:13 -04:00
Jose Diaz-Gonzalez
325b9258e4 Clarify that the checks are only run against the web process
Closes #2186

[ci skip]
2016-05-14 14:36:53 -04:00
Jose Diaz-Gonzalez
8cef6b2074 Merge pull request #2191 from dokku/2041-upgrade-docs
Clarify upgrade docs for bootstrap.sh installations
2016-05-14 14:29:34 -04:00
Jose Diaz-Gonzalez
fe00835aa7 clarify what happens when installing via the bootstrap.sh file
Closes #2041

[ci skip]
2016-05-14 14:28:46 -04:00
Jose Diaz-Gonzalez
ad0d2b1f6d Remove unused contents from docs/index.md
[ci skip]
2016-05-14 14:28:46 -04:00
Jose Diaz-Gonzalez
c27b0c08ed Merge pull request #2187 from pltchuong/patch-1
Update plugin-triggers.md
2016-05-14 11:51:26 -04:00
Jose Diaz-Gonzalez
c73094615e Merge pull request #2175 from dokku/2174_mh-dokku-enter-errmsg
show available types and ids on dokku enter error
2016-05-13 14:30:45 -04:00
Phan Chuong
989ea72490 Update plugin-triggers.md 2016-05-13 09:05:11 -07:00
Michael Hobbs
d9e1548683 Merge pull request #2190 from cu12/add-elasticmq-plugin
Add ElasticMQ plugin to documentation
2016-05-13 07:48:14 -07:00
Domonkos Czinke
e474d49320 Remove newline 2016-05-13 14:45:20 +02:00
Domonkos Czinke
e4d916c308 Add ElasticMQ plugin to documentation 2016-05-13 14:39:52 +02:00
Phan Chuong
e30c01c234 Update plugin-triggers.md
add missing trigger
2016-05-12 20:53:51 -07:00
Michael Hobbs
9ae9c7ad11 Merge pull request #2183 from Epigene/patch-2
Update nginx.md
2016-05-12 08:48:11 -07:00
Augusts Bautra
ea240f117e Update nginx.md
In the spirit of discoverability and least surprise, primary custom template example mirrors nginx.conf generated by default.
2016-05-12 18:45:07 +03:00
Michael Hobbs
68fb0e7b98 Merge pull request #2182 from cu12/add-fake_sns-plugin
Add link to FakeSNS plugin
2016-05-12 06:12:53 -07:00
Domonkos Czinke
9d74f1ecf2 Add FakeSNS plugin to documentation 2016-05-12 14:52:36 +02:00
Michael Hobbs
2356dbd594 make buggy docker-options test consistent 2016-05-11 17:53:12 -07:00
Michael Hobbs
7aa48d3426 enter default container type if only a single type is running 2016-05-11 16:40:10 -07:00
Michael Hobbs
b8b4f6fedf show available types and ids on dokku enter error. closes #2174 2016-05-11 13:12:07 -07:00
Michael Hobbs
25a2801cb1 Merge pull request #2170 from jvanbaarsen/dont-fail-duplicated-domain
Dont fail when adding a duplicated domain
2016-05-10 14:06:04 -07:00
Jeroen van Baarsen
86ef6ae5d1 Make sure we shift by 1 to remove the app_name from the $@ var 2016-05-10 21:31:53 +02:00
Michael Hobbs
4e99078ac1 Merge pull request #2173 from dokku/2171_mh-test-restore
add test for ps:restore with undeployed app
2016-05-10 10:53:41 -07:00
Michael Hobbs
7de160b64d add test for ps:restore with undeployed app. refs #2171 2016-05-10 09:30:55 -07:00
Michael Hobbs
99030a110c Merge pull request #2171 from vshn/fix_apprestore_on_boot
allow all apps to be restored on boot
2016-05-10 08:14:05 -07:00
Tobias Brunner
ee18909935 allow all apps to be restored on boot
When rebooting a Dokku host the init process tries to restore all apps
using `dokku ps:restore`, alphabetically. If an app is defined but not
deployed, the function `ps_start` called by `dokku ps:restore` will
exit 0 and stop trying to restore the other apps later in the alphabet.
This change fixes the restore behaviour.
2016-05-10 11:41:25 +02:00
Jeroen van Baarsen
4f621916a7 Dont fail when adding a duplicated domain
Currently we exit when trying to add a duplicated domain, even if we give a list
of domain names. This behaviour is not as it suppose to work.

**Expected behaviour**
When adding a domain, and the domain already exists, just skip that domain, and
continue with the world. This is no problem since we are already in the state we
want to be in.

**New behaviour**
When you try to add a domain that is already added, we notify the user of this
by showing a log message: `Skipping: example.com already added to example app`,
and then we continue with the list of domain names.

Fixes #2165
2016-05-10 08:58:15 +02:00
Jose Diaz-Gonzalez
f89f946c40 Merge pull request #2167 from iloveitaly/rollbar-plugin
Adding link to rollbar plugin
2016-05-09 12:53:15 -04:00
Michael Bianco
8e34477c96 Adding link to rollbar plugin 2016-05-09 12:41:57 -04:00
Jose Diaz-Gonzalez
5940e43c85 Merge pull request #2164 from iloveitaly/additional-plugins
Adding longtimeout and hostname to dokku plugin list
2016-05-07 20:56:41 -04:00
Michael Bianco
c1c76362e7 Adding longtimeout and hostname to dokku plugin list 2016-05-07 17:53:06 -04:00
Michael Hobbs
a034ec9803 Merge pull request #2163 from dokku/2153_mh-extract-ports-from-image
support deployment of arbitrary docker images not built by dokku build
2016-05-06 12:08:58 -07:00
Michael Hobbs
2da4f5ef03 [ci skip] clarify how we get ports when deploying an arbitrary image 2016-05-06 11:45:58 -07:00
Michael Hobbs
d7386317fc support deployment of arbitrary docker images not built by dokku build. closes #2153 2016-05-06 11:30:22 -07:00
Michael Hobbs
851ca592d5 Merge pull request #2157 from dokku/mh-run-detached-test
test detached container is running
2016-05-03 12:14:23 -07:00
Michael Hobbs
9d584ed145 test detached container is running 2016-05-03 08:22:49 -07:00
Jose Diaz-Gonzalez
ac1c4dc571 Merge pull request #2155 from dokku/detached-run
Add the ability to run containers in detached mode
2016-05-03 10:53:45 -04:00
Jose Diaz-Gonzalez
32505b14e7 Update HISTORY.md 2016-05-02 21:12:01 -04:00
Jose Diaz-Gonzalez
1bcd76ffe9 Add detached run tests 2016-05-02 21:11:28 -04:00
Jose Diaz-Gonzalez
565cd5c0e8 Update one-off-processes.md
[ci skip]
2016-05-02 12:37:49 -04:00
Jose Diaz-Gonzalez
8597b692ee Add the ability to run containers in detached mode 2016-05-02 00:02:37 -04:00
Jose Diaz-Gonzalez
e9447a26d9 Release 0.5.6 2016-04-29 16:07:58 -04:00
Michael Hobbs
17a602efe8 Merge pull request #2150 from dokku/2149_mh-config-vars-in-nginx-template
export app config vars into sigil environment for use in nginx templates
2016-04-27 12:50:49 -07:00
Michael Hobbs
7b1bc522f6 export app config vars into sigil environment for use in nginx templates. closes #2149 2016-04-27 11:56:50 -07:00
Michael Hobbs
64f83f976e small refactor to support config_set for globals (#2147)
* initial pass at config refactor

* support --shell and make sure we unset config globals
2016-04-26 18:08:54 -07:00
Michael Hobbs
cb9efa3322 implement docker stop timeout. closes #2126 (#2148) 2016-04-26 18:06:55 -07:00
Michael Hobbs
28f83ab0d5 Merge pull request #2145 from dokku/mh-fix-tests
fix dockerfile-procfile test
2016-04-25 19:27:58 -07:00
Michael Hobbs
be13b0149a use node base image instead of ubuntu 2016-04-25 18:47:39 -07:00
Michael Hobbs
e73c89abc8 include dockerfile-procfile test app in Makefile 2016-04-25 18:47:33 -07:00
Lorenzo Sicilia
7a36ecf196 fix typo nignx -> nginx (#2144) 2016-04-25 17:37:50 -07:00
Michael Hobbs
33dd90a091 Merge pull request #2142 from Aluxian/patch-1
Add Aluxian/dokku-nginx-cache to the list of plugins
2016-04-25 06:56:22 -07:00
Alexandru Rosianu
c67a4dcc7d Update compatibility for plugin dokku-nginx-cache 2016-04-25 11:15:22 +03:00
Alexandru Rosianu
546551e6e9 Add Aluxian/dokku-nginx-cache to the list of plugins 2016-04-25 11:09:26 +03:00
Jose Diaz-Gonzalez
bd4aee0864 Merge pull request #2129 from christiangenco/patch-3
condense upgrading instructions
2016-04-23 00:29:33 -04:00
Jose Diaz-Gonzalez
06d18b4cbd Merge pull request #2136 from dokku/josegonzalez-patch-1
Use `sleep infinity` for enter cron task
2016-04-23 00:28:45 -04:00
Jose Diaz-Gonzalez
075de78442 Use sleep infinity for enter cron task
Closes #2135

[ci skip]
2016-04-23 00:28:37 -04:00
Michael Hobbs
3cead25acf call dokku to set global config as config plugin scope workaround. closes #2111 (#2130) 2016-04-20 19:01:05 -07:00
Christian Genco
559347f985 /docs => /dokku in upgrading.md 2016-04-20 15:43:39 -05:00
Christian Genco
613679352b condense upgrading instructions + fix broken links 2016-04-20 15:32:52 -05:00
Michael Hobbs
d6c7682068 [ci skip] add some 'neat' plugins by michaelshobbs (#2128) 2016-04-20 13:27:44 -07:00
Jose Diaz-Gonzalez
4cd847fb27 Merge pull request #2127 from crisward/patch-5
added dokku require plugin
2016-04-20 16:04:16 -04:00
Cris Ward
58e3556e0e added dokku require plugin 2016-04-20 21:00:05 +01:00
Cris Ward
500a6dd73b updated hosts file description (#2124) 2016-04-19 07:27:42 -07:00
Michael Hobbs
7d3571757d Merge pull request #2122 from dokku/mh-fix-tests-post-dns-change
add 10.0.0.2 so *.dokku.me works
2016-04-18 21:58:00 -07:00
Michael Hobbs
26ee0d7ae2 add 10.0.0.2 so *.dokku.me works 2016-04-18 20:57:44 -07:00
Justin Clark
13f7727fe3 Merge pull request #2120 from dokku/u2mejc-issue2119
Add apex help_content for certs,nginx,storage,tar plugins
2016-04-18 12:19:53 -07:00
Justin Clark
8a14b34446 Add apex help_content for certs,nginx,storage,tar plugins
Also corrects some punctuation in associated help_content.
2016-04-18 11:37:23 -07:00
Jose Diaz-Gonzalez
6a39fd70e1 Merge pull request #2116 from dokku/warn-on-low-memory
Warn users when there is a low memory condition on installation
2016-04-16 17:46:34 -04:00
Jose Diaz-Gonzalez
fff050c71d Warn users when there is a low memory condition on installation
Closes #1971

[ci skip]
2016-04-16 17:46:07 -04:00
Jose Diaz-Gonzalez
61327620da Merge pull request #2115 from dokku/2067-hot-coffee-is-hot
Document potential dockerfile/nginx.conf.sigil issues
2016-04-16 17:31:08 -04:00
Jose Diaz-Gonzalez
80cc57caa0 Add a note as to Dockerfile support being a power-user feature
Closes #2067

[ci skip]
2016-04-16 17:30:09 -04:00
Jose Diaz-Gonzalez
55f38414d1 Add a note about the nginx.conf.sigil being publicly exposed, and how to remove it.
[ci skip]
2016-04-16 17:27:52 -04:00
Daiwei
96da38a8e4 Fix typo 2016-04-16 16:53:43 -04:00
Daiwei
25b144e496 Remove redundant 2016-04-16 16:52:33 -04:00
Daiwei
478f5e34d3 Add instruction to pull image from docker hub 2016-04-16 16:52:05 -04:00
Jose Diaz-Gonzalez
47dfa921cd Merge pull request #2114 from dokku/table-of-contents
Add table of contents to sidebar when there is a table of contents
2016-04-16 16:40:24 -04:00
Jose Diaz-Gonzalez
c162f57dbd Add table of contents to sidebar when there is a table of contents
[ci skip]
2016-04-16 16:39:53 -04:00
Jose Diaz-Gonzalez
92073eda12 Merge pull request #2112 from dokku/alphabetize-triggers
Alphabetize triggers
2016-04-16 16:14:03 -04:00
Jose Diaz-Gonzalez
bb9b36b291 Add missing plugin triggers to the events plugin 2016-04-16 14:46:40 -04:00
Jose Diaz-Gonzalez
8b93d9bf54 Alphabetize plugin triggers
This will make editing them later easier
2016-04-16 14:46:24 -04:00
Jose Diaz-Gonzalez
d7566daacc Allow user to modify the repository and tag when deploying an app
Uses two new plugin triggers:

- deployed-app-repository
- deployed-app-image-tag

Useful when the image is a custom tagged image on a remote repository
2016-04-16 08:35:18 -04:00
Jose Diaz-Gonzalez
7b8cefbadc Merge pull request #2107 from unfold/deploy-images-ci-documentation
Add CI deployment recipe
2016-04-16 04:11:06 -04:00
Simen Brekken
579ffa5a62 Add Docker Registry note 2016-04-14 06:55:42 +02:00
Simen Brekken
c6fa061604 Fix invalid highlighting language 2016-04-14 06:55:13 +02:00
Jose Diaz-Gonzalez
fd811b020a Clarify note a bit
[ci skip]
2016-04-14 00:38:44 -04:00
Jose Diaz-Gonzalez
9ae2ab105b Merge pull request #2099 from ojosdegris/patch-1
Added clarification on configuration via separate files
2016-04-14 00:36:25 -04:00
Simen Brekken
1a94a62fe3 Add CI deployment recipe 2016-04-14 06:28:31 +02:00
Jose Diaz-Gonzalez
a13a0df35e Release 0.5.5 2016-04-13 13:32:04 -04:00
Jose Diaz-Gonzalez
f6bdd948b1 Merge pull request #2105 from dokku/josegonzalez-patch-1
Add a note about how disabling the proxy affects the host port an application is deployed to
2016-04-13 12:48:08 -04:00
Jose Diaz-Gonzalez
1ceee12fc4 Add a note about how disabling the proxy affects the host port an application is deployed to
[ci skip]
2016-04-13 12:47:50 -04:00
Jose Diaz-Gonzalez
dbacfed855 Merge pull request #2104 from crisward/patch-2
Added new plugin
2016-04-13 11:51:51 -04:00
Cris Ward
3ac21ae9a3 Added new plugin 2016-04-13 16:20:49 +01:00
Michael Hobbs
7985e93e29 Merge pull request #2102 from dokku/josegonzalez-patch-1
Only strip .git directory from end of url
2016-04-13 05:48:33 -07:00
Jose Diaz-Gonzalez
4230e816df Allow acl-add to fail 2016-04-12 19:37:45 -04:00
Jose Diaz-Gonzalez
ae3aae9af8 Only strip .git directory from end of url 2016-04-12 19:13:45 -04:00
Jose Diaz-Gonzalez
67d7a64a51 Merge pull request #2100 from kane-c/fix-domain-menu-link
Fix docs navigation link to domain configuration
2016-04-12 11:13:14 -04:00
vittore
cdc327b777 Added clarification on configuration via separate files 2016-04-11 12:29:25 -04:00
Kane
3c9a1d488b Fix docs navigation link to domain configuration
When `domains.md` was moved to `domain-configuration.md` this link was not updated.
2016-04-11 18:23:34 +10:00
Jose Diaz-Gonzalez
72d46ba64b Merge pull request #2098 from dokku/blog-link
Add a blog link to the header area
2016-04-11 01:54:28 -04:00
Jose Diaz-Gonzalez
d9feca5606 Add a blog link to the header area
[ci skip]
2016-04-11 01:52:57 -04:00
Jose Diaz-Gonzalez
f29f4294c7 Merge pull request #2089 from dokku/2086-ssl-certs
Update how ssl and multiple domains interact
2016-04-09 15:15:22 -04:00
Michael Hobbs
db94fcb6b4 include non ssl server names in SSL server block. fixes #2086 2016-04-08 13:21:26 -07:00
Jose Diaz-Gonzalez
4945bd79ca Merge pull request #2094 from dokku/josegonzalez-patch-1
Create storage directories on install. Closes #2091
2016-04-08 11:22:56 -04:00
Jose Diaz-Gonzalez
22d053c9d0 Create storage directories on install. Closes #2091
[ci skip]
2016-04-08 11:22:43 -04:00
Jose Diaz-Gonzalez
6482ae164c Merge pull request #2093 from econya/2091-DOC-fix_storage_example_path
#2092: fix path in storage example
2016-04-08 11:18:43 -04:00
Felix Wolfsteller
7900a2e97e #2092: fix path in storage example 2016-04-08 12:52:04 +02:00
Jose Diaz-Gonzalez
95993955c5 Move customizing-hostnames documentation
[ci skip]
2016-04-07 21:15:59 -04:00
Jose Diaz-Gonzalez
6b48b250a7 Add documentation on customizing hostnames
[ci skip]
2016-04-07 21:14:56 -04:00
Jose Diaz-Gonzalez
66ad41f814 Fix links
[ci skip]
2016-04-07 21:14:12 -04:00
Jose Diaz-Gonzalez
a36d35d752 Update ssl-configuration.md
[ci skip]
2016-04-07 21:13:18 -04:00
Jose Diaz-Gonzalez
89d1a9751c Update and rename domains.md to domain-configuration.md
[ci skip]
2016-04-07 21:12:58 -04:00
Jose Diaz-Gonzalez
841c8c22d7 Fix casing
[ci skip]
2016-04-07 21:12:36 -04:00
Jose Diaz-Gonzalez
cb9d98a819 Add domain configuration link
[ci skip]
2016-04-07 21:12:18 -04:00
Jose Diaz-Gonzalez
a62bae8c7c Fix link to the domains plugin 2016-04-07 21:08:59 -04:00
Jose Diaz-Gonzalez
344a63b956 Move the domains documentation to its own page 2016-04-07 21:07:47 -04:00
Jose Diaz-Gonzalez
0ea44cfafb Create domains.md 2016-04-07 21:07:21 -04:00
Jose Diaz-Gonzalez
1948a41949 Add a note on how ssl and multiple domains interact
Refs #2086
2016-04-07 21:03:44 -04:00
Jose Diaz-Gonzalez
50e928b685 Merge pull request #2088 from dokku/josegonzalez-patch-1
Upgrade herokuish package
2016-04-07 20:35:34 -04:00
Jose Diaz-Gonzalez
7352cd05c5 Upgrade herokuish 2016-04-07 18:49:53 -04:00
Jose Diaz-Gonzalez
94980c8394 Upgrade herokuish package
Refs #2079
2016-04-07 12:40:02 -04:00
Jose Diaz-Gonzalez
ba66a42891 Clarify contributing documentation
[ci skip]
2016-04-06 15:35:41 -04:00
Jose Diaz-Gonzalez
1ec1a6cd7d Merge pull request #2084 from louisbl/patch-2
Clarify where to put nginx custom template without `WORKDIR`
2016-04-06 09:56:25 -04:00
Jose Diaz-Gonzalez
58eb6f3c54 Merge pull request #2083 from louisbl/patch-1
Clarify 0.5.0 migration guide about `EXPOSE`
2016-04-06 09:56:20 -04:00
Louis Beltramo
78e106cff2 Clarify where to put nginx custom template without WORKDIR
Docker assume `/` as [default `WORKDIR`](https://docs.docker.com/engine/reference/run/#workdir), but dokku [looks in the `/app` folder](https://github.com/dokku/dokku/blob/master/plugins/common/functions#L257)

[ci skip]
2016-04-06 13:00:53 +02:00
Louis Beltramo
1cf82a6020 Clarify 0.5.0 migration guide about EXPOSE
Make it clear that there is now a 1:1 port mapping.
Add links to doc
2016-04-06 12:38:32 +02:00
Jose Diaz-Gonzalez
7938bd08ae Fix slack logo link 2016-04-06 01:56:17 -04:00
Jose Diaz-Gonzalez
20312ffa4b fix slack button link 2016-04-06 01:53:59 -04:00
Jose Diaz-Gonzalez
539b765e21 Update link for flink 2016-04-06 01:46:29 -04:00
Jose Diaz-Gonzalez
36edeb2401 Add team images 2016-04-06 01:40:45 -04:00
Michael Hobbs
58af2417e2 Merge pull request #2082 from dokku/2078_mh-custom-nginx-forwarding-ssl
add use case example for ssl redirect
2016-04-05 17:18:19 -07:00
Michael Hobbs
5fc97e9553 [ci skip] add use case example for ssl redirect. closes #2078 2016-04-05 17:03:41 -07:00
Michael Hobbs
3e868a41e9 Merge pull request #2080 from dokku/mh-issue-template-dockerfile
clarify the need for contents of dockerfile
2016-04-05 09:32:57 -07:00
Michael Hobbs
2e7dde73ab [ci skip] clarify the need for contents of dockerfile 2016-04-05 09:32:33 -07:00
Jose Diaz-Gonzalez
c72d337f69 Merge pull request #2076 from dokku/josegonzalez-patch-1
Add a note to dockerfile deploys concerning ports being exposed as http
2016-04-05 10:47:24 -04:00
Jose Diaz-Gonzalez
a8c1b728d2 Add a note to dockerfile deploys concerning ports being exposed as http
Closes #2075

[ci skip]
2016-04-05 10:47:10 -04:00
Jose Diaz-Gonzalez
f328a9940b Release 0.5.4 2016-04-05 03:09:29 -04:00
Jose Diaz-Gonzalez
1ef5b92910 Merge pull request #2072 from dokku/2071_mh-clarify-dockerfile-expose
note that we only support one EXPOSE port per line in dockerfiles
2016-04-04 15:36:08 -04:00
Michael Hobbs
1dd07aeda9 [ci skip] note that we only support one EXPOSE port per line in dockerfiles. closes #2071 2016-04-04 12:34:56 -07:00
Jose Diaz-Gonzalez
1628f60553 Merge pull request #2070 from dokku/upgrade-sshcommand
Upgrade sshcommand
2016-04-03 23:37:27 -04:00
Jose Diaz-Gonzalez
970f4489d4 Upgrade to sshcommand 0.4.0 2016-04-03 20:22:03 -04:00
Jose Diaz-Gonzalez
997cec4b9b Upgrade to sshcommand 0.3.0 2016-04-03 20:21:01 -04:00
Jose Diaz-Gonzalez
127b7a15b5 Merge pull request #2068 from dokku/sshcommand-packaging
Use latest sshcommand when installing via debian
2016-04-02 23:03:11 -04:00
Jose Diaz-Gonzalez
bbf310147e Upgrade sshcommand to 0.2.0 2016-04-02 22:22:50 -04:00
Jose Diaz-Gonzalez
858240874c Update packaging to use released sshcommand version 2016-04-02 22:20:39 -04:00
Jose Diaz-Gonzalez
7bddd8751e Use released sshcommand
This is what we actually give users who install via the preferred method, and thus we shouldn't be running tests from master.
2016-04-02 22:20:26 -04:00
Jose Diaz-Gonzalez
0540c254d0 Merge pull request #2065 from dokku/2062_mh-app-json-exit-on-error
fix pre/post deploy support for dockerfile apps
2016-04-02 05:12:07 -04:00
Michael Hobbs
6caed369d7 set pipefail on pre/post deploy tasks. fix pre/post deploy support for dockerfile apps. closes #2062 2016-04-01 14:06:35 -07:00
Jose Diaz-Gonzalez
9da47d84e0 Merge pull request #2060 from dokku/mh-filter-restart-exec-json
filter restart policies from exec-app-json containers
2016-04-01 13:13:42 -04:00
Michael Hobbs
6450f9332a Merge pull request #2061 from znz/fix-settings-in-checks-file
Fix ignored settings in the CHECKS file
2016-03-31 22:43:29 -07:00
Kazuhiro NISHIYAMA
722564b2da Fix ignored settings in the CHECKS file 2016-04-01 13:55:25 +09:00
Michael Hobbs
a93e180a89 filter restart policies from exec-app-json containers 2016-03-31 15:29:04 -07:00
Jose Diaz-Gonzalez
8cbc36fd22 Merge pull request #2058 from dokku/2057_mh-remove-global-tls-refs
remove references to global TLS certs
2016-03-31 13:02:16 -04:00
Michael Hobbs
8d84721882 Merge pull request #2055 from vshn/fix_include
move include to server section
2016-03-31 07:54:48 -07:00
Michael Hobbs
c739c770f7 remove references to global TLS certs. closes #2057 2016-03-31 07:52:19 -07:00
Tobias Brunner
d01961424d move include to server section
This replicates the behaviour of location.config and makes the
letsencrypt plugin usable again for Dockerfile deployments
2016-03-31 09:43:44 +02:00
Jose Diaz-Gonzalez
e114ab3f20 Merge pull request #2052 from dokku/2048-upstream-packaging
Use upstream releases when creating deb packages. Closes #2048
2016-03-30 19:48:18 -04:00
Jose Diaz-Gonzalez
ebd185a798 Merge pull request #2051 from plieningerweb/patch-1
Fix installation instructions in docs
2016-03-30 15:45:57 -04:00
Jose Diaz-Gonzalez
eb4e5957cd Use upstream releases when creating deb packages. Closes #2048
- drop golang dependency
- use wget to retrieve upstream dependency

[ci skip]
2016-03-30 15:45:32 -04:00
plieningerweb
429eb4af83 Fix installation instructions in docs
Clearly stress the fact, that there are more steps than only running the bash commands. You also have to navigate to the website and finish the configuration.
2016-03-30 19:19:58 +02:00
Jose Diaz-Gonzalez
fb88783f9d Merge pull request #2049 from mmlkrx/patch-1
Fix typo in deployment-tasks.md
2016-03-30 02:39:09 -04:00
Matthias Loker
aa2f02b1d2 Fix typo in deployment-tasks.md 2016-03-30 08:31:14 +02:00
Jose Diaz-Gonzalez
9dfe14fe33 Release 0.5.3 2016-03-30 01:24:14 -04:00
Jose Diaz-Gonzalez
71b040cabe Merge pull request #2030 from dokku/2029-fix-variable-iteration
Fix setting of APPS when $1 is left unspecified
2016-03-30 01:09:36 -04:00
Jose Diaz-Gonzalez
4a310dc53f Merge pull request #2047 from dokku/2040_mh-mktemp-cleanup
remove deprecated mktemp args and name vars more clearly
2016-03-30 00:15:04 -04:00
Jose Diaz-Gonzalez
e7e249d1d3 Ensure we release the trap avoid running cleanup twice 2016-03-29 23:31:03 -04:00
Jose Diaz-Gonzalez
af97275139 Rename the cleanup command to make it more readable in logging output 2016-03-29 23:29:41 -04:00
Michael Hobbs
9ce7470b87 remove deprecated mktemp args and name vars more clearly 2016-03-29 19:46:46 -07:00
Michael Hobbs
8a4b2f9a2e Merge pull request #2046 from dokku/2044_mh-support-inline-comments
strip inline comments from CHECKS and Procfile
2016-03-29 18:17:56 -07:00
Jose Diaz-Gonzalez
823b5c27da Merge pull request #2045 from dokku/u2mejc-issue2028
Reword dockerfiles.md to clarify EXPOSE handling in 0.5.x
2016-03-29 19:26:13 -04:00
Michael Hobbs
7e1516bdf5 strip inline comments from CHECKS and Procfile. closes #2044 2016-03-29 16:22:00 -07:00
Justin Clark
3eb9a50921 Reword dockerfiles.md to clarify EXPOSE handling in 0.5.x 2016-03-29 15:56:30 -07:00
Michael Hobbs
6ed457d1f7 Merge pull request #2042 from dokku/2037_mh-checks-newline
ensure CHECKS file has trailing newline
2016-03-29 15:56:07 -07:00
Jose Diaz-Gonzalez
3b076f6f01 Merge pull request #2043 from dokku/2028_mh-clarify-dockerfile-ports
clarify dockerfile port exposure. remove reference to DOKKU_DOCKERFILE_PORT
2016-03-29 14:44:20 -04:00
Michael Hobbs
45551c3c5b clarify dockerfile port exposure. remove reference to DOKKU_DOCKERFILE_PORT. closes #2028 2016-03-29 11:31:14 -07:00
Michael Hobbs
8c31c8105e ensure CHECKS file has trailing newline. closes #2037 2016-03-29 11:10:48 -07:00
Jose Diaz-Gonzalez
9ccbc834b5 Merge pull request #2039 from christiangenco/patch-2
Update upgrading.md
2016-03-29 13:18:28 -04:00
Christian Genco
2c409687d5 Update upgrading.md 2016-03-28 21:09:37 -05:00
Michael Hobbs
6c51115e14 Merge pull request #2035 from stesie/patch-1
Fix ps_restart to not exit early
2016-03-28 13:01:17 -07:00
Stefan Siegl
088ee071ca Fix ps_restart to not exit
ps_restartall_cmd calls ps_restart from a loop, if ps_restart exits because of a not deployed app further apps might not be restarted.
2016-03-28 20:34:17 +02:00
Jose Diaz-Gonzalez
c245ba3a5d Merge pull request #2032 from dokku/upstream-docs
Fix upstream positioning in docs. Closes #2031
2016-03-28 03:18:41 -04:00
Jose Diaz-Gonzalez
8cf20db7e1 Fix upstream positioning in docs. Closes #2031
[ci skip]
2016-03-28 03:18:03 -04:00
Jose Diaz-Gonzalez
8c39685ef6 Fix setting of APPS when $1 is left unspecified
Closes #2029
2016-03-28 01:50:58 -04:00
Jose Diaz-Gonzalez
20dfd20416 Fix proxy link
[ci skip]
2016-03-27 20:48:08 -04:00
Jose Diaz-Gonzalez
12ca7adcd1 Release 0.5.2 2016-03-27 17:09:36 -04:00
Jose Diaz-Gonzalez
a4e8efedc8 Merge pull request #2027 from dokku/2025_mh-sigil-deb-dep
add sigil to debian control file
2016-03-27 17:01:49 -04:00
Michael Hobbs
d86ed5d6ee [ci skip] add sigil to debian control file. closes #2025 2016-03-27 10:30:06 -07:00
Jose Diaz-Gonzalez
668dc0e7a5 Release 0.5.1 2016-03-26 19:54:25 -04:00
Jose Diaz-Gonzalez
f5b454e110 Merge pull request #2024 from dokku/delete-bad-symlinks
Delete bad symlinks without confirmation
2016-03-26 19:33:13 -04:00
Jose Diaz-Gonzalez
aefd5bb251 Delete bad symlinks without confirmation
[ci skip]
2016-03-26 19:28:09 -04:00
Jose Diaz-Gonzalez
8b8df9e093 Merge pull request #2023 from dokku/sigil-packaging
Sigil packaging
2016-03-26 19:20:13 -04:00
Jose Diaz-Gonzalez
cdd62b09d3 Correctly build sigil using the sigil makefile
[ci skip]
2016-03-26 19:19:32 -04:00
Jose Diaz-Gonzalez
107697dc95 Clone proper sigil tag for packaging
[ci skip]
2016-03-26 19:19:12 -04:00
Jose Diaz-Gonzalez
cae5030804 Release 0.5.0
- Drop tutum-agent, lxc-docker, docker.io apt package support
- Release a new herokuish version
- Fix release docs
- Upgrade sigil
2016-03-26 18:13:14 -04:00
Pascal Widdershoven
f073ebe4cd Cleanup Procfile after using it in dokku run 2016-03-24 08:47:49 +01:00
Pascal Widdershoven
5bc3e14eb4 Silence extract_profile logging output in dokku run 2016-03-24 07:36:48 +01:00
Pascal Widdershoven
6548cc4477 Update test to not depend on passing named arguments via Herokuish
There may be a bug in Herokuish that messes up with quoted named
arguments, see discussion in
https://github.com/dokku/dokku/pull/2018
2016-03-24 07:34:43 +01:00
Pascal Widdershoven
e64daa18cf First stab at dokku run Procfile shorthand 2016-03-23 21:36:50 +01:00
Michael Hobbs
4357e529ce Merge pull request #1983 from dokku/u2mejc-issue1688
Collapse help into expandable command topics
2016-03-22 15:02:39 -07:00
Michael Hobbs
7becc749aa Merge pull request #2013 from dokku/mh-issue1688-help-desc
make help desc local consistent
2016-03-22 13:54:23 -07:00
Michael Hobbs
de9b1f6273 [ci skip] make help desc local consistent 2016-03-22 13:33:35 -07:00
Justin Clark
14a1d06c03 Collapse help into expandable command topics 2016-03-22 10:50:20 -07:00
Michael Hobbs
f864017cc5 Merge pull request #2012 from dokku/mh-minor-bug-fixes
minor bug fixes around app.json and docker-options
2016-03-22 06:50:56 -07:00
Michael Hobbs
0f4ff8b724 no need for newlines in docker args 2016-03-21 18:57:14 -07:00
Michael Hobbs
024f98c2c8 make sure we set HOME and exit with status from app.json script 2016-03-21 18:56:20 -07:00
Michael Hobbs
1b78f5c882 actually test docker-options are ending up in container config 2016-03-21 09:26:27 -07:00
Jose Diaz-Gonzalez
693297ac9e Add missing dividers
[ci skip]
2016-03-21 01:48:16 -04:00
Jose Diaz-Gonzalez
ff6677b932 Merge pull request #2011 from dokku/jdg-installation-docs
Updated installation docs
2016-03-21 01:46:42 -04:00
Jose Diaz-Gonzalez
aaad577a68 Fix formatting on upgrading docs
[ci skip]
2016-03-21 01:41:03 -04:00
Jose Diaz-Gonzalez
b315fcfbdd Fix formatting in "Where to get help" docs
[ci skip]
2016-03-21 01:40:51 -04:00
Jose Diaz-Gonzalez
e011ed0b3e Better landing page
- unified css between home and template layouts
- use same version of bootstrap everywhere
- add our cute whale sushi logo to the homepage
- use fewer styles
- add a better installation section to point out different installation methods
- add navigation bar items

[ci skip]
2016-03-21 01:40:23 -04:00
Jose Diaz-Gonzalez
4b253c80f7 use addEventListener wrapper where necessary to add simple support for older browsers 2016-03-20 21:45:33 -04:00
Jose Diaz-Gonzalez
9b9872db60 properly link to memory tip
[ci skip]
2016-03-20 21:41:22 -04:00
Jose Diaz-Gonzalez
7682fb0029 Redirect to correct landing page 2016-03-19 23:32:34 -04:00
Jose Diaz-Gonzalez
fc63061eaf Merge pull request #2009 from samholmes1337/master
Clarify purpose and potential penalties of primary vhost
2016-03-19 02:46:48 -04:00
Sam Holmes
43759985f2 Clarify purpose and penalties of primary vhost 2016-03-19 02:17:26 +00:00
Jose Diaz-Gonzalez
2eb1f256fb Merge pull request #2007 from dokku/josegonzalez-patch-1
Document when configuration variables are available. Closes #1860
2016-03-18 10:42:16 -04:00
Jose Diaz-Gonzalez
49cf31baad Document when configuration variables are available. Closes #1860
[ci skip]
2016-03-18 10:42:02 -04:00
Jose Diaz-Gonzalez
b97fbde7e2 Merge pull request #2006 from baob/fix-too-many-redirects
Fix too many redirects
2016-03-18 10:36:04 -04:00
baob
391f9358a6 Fix too many redirects
Example error message on vagrant up:

Error response from daemon: Get
https://registry-1.docker.io/v2/library/postgres/manifests/9.5.0:
Get
https://auth.docker.io/token?scope=repository%3Alibrary%2Fpostgres%3Apull&service=registry.docker.io:
dial tcp: lookup auth.docker.io on 10.0.2.3:53: too many redirects
2016-03-18 14:15:47 +00:00
Jose Diaz-Gonzalez
2d99da59c4 Merge pull request #1987 from dokku/1889-dont-start-stopped
Do not restart stopped processes on config:set/unset
2016-03-18 09:51:31 -04:00
Jose Diaz-Gonzalez
097d0e67bc Merge pull request #2004 from dokku/josegonzalez-patch-1
Document 0.5.x container removal strategy. Closes #1982
2016-03-18 01:52:35 -04:00
Jose Diaz-Gonzalez
9da1d5d0ea Document 0.5.x container removal strategy. Closes #1982
[ci skip]
2016-03-18 01:52:29 -04:00
Michael Hobbs
f930a974a5 Merge pull request #2003 from dokku/mh-dep-tasks-docs
add more useful post-deploy task and make blockquote
2016-03-16 14:24:14 -07:00
Michael Hobbs
a3b1730719 [ci skip] add more useful post-deploy task and make blockquote 2016-03-16 14:23:05 -07:00
Michael Hobbs
273cfc1013 Merge pull request #2002 from dokku/mh-dep-tasks-docs
clarify deployment tasks are supported in both buildpack and dockerfile apps
2016-03-16 13:51:33 -07:00
Michael Hobbs
111bac03ab [ci skip] clarify deployment tasks are supported in both buildpack and dockerfile apps 2016-03-16 13:51:08 -07:00
Michael Hobbs
a33b4ee99a Merge pull request #2000 from iamale/patch-1
Add dokku-monorepo to the plugin list in docs
2016-03-16 06:07:18 -07:00
Alexander Pushkov
4474236780 Add Monorepo plugin 2016-03-16 12:51:20 +03:00
Michael Hobbs
846d1fef2b Merge pull request #1993 from istarkov/master
Fix bash incorrect test command
2016-03-14 12:23:31 -07:00
Ivan Starkov
34a881f917 Fix incorrect test command 2016-03-14 20:18:40 +03:00
Jose Diaz-Gonzalez
d521932dcb Merge pull request #1992 from Sureiya/dokku-client-docs
Improved documentation for using official dokku_client.sh
2016-03-13 21:29:37 -04:00
Chris Modjeska
b255b6a700 Improved documentation for using official dokku_client.sh 2016-03-13 20:42:05 -04:00
Jose Diaz-Gonzalez
9bd092b6ec Fix scoping of css on .dev-warning
[ci skip]
2016-03-13 15:46:37 -04:00
Jose Diaz-Gonzalez
65e3b8d0f7 Use titlecase where necessary
[ci skip]
2016-03-13 15:40:38 -04:00
Jose Diaz-Gonzalez
5507db1d18 Merge pull request #1990 from ligthyear/fix-the-docs
Highlight features that are yet to come
2016-03-13 15:38:59 -04:00
Jose Diaz-Gonzalez
502d4c9e51 Merge pull request #1991 from dokku/fix-non-existent-VHOST
Only chown of existing files
2016-03-13 15:14:19 -04:00
Morris Jobke
01430cd618 Only chown of existing files
* this caused issues during installation if the file is not existent
2016-03-13 18:00:34 +01:00
Benjamin Kampmann
3e1a9abe9b Titlecase 2016-03-13 14:41:27 +01:00
Benjamin Kampmann
63db85b244 Merge pull request #1 from josegonzalez/patch-1
Minor changes
2016-03-13 12:33:06 +01:00
Jose Diaz-Gonzalez
f2050b6a11 Tone down the green 2016-03-13 06:53:22 -04:00
Jose Diaz-Gonzalez
6abdf34054 tone down the green 2016-03-13 06:52:56 -04:00
Jose Diaz-Gonzalez
091489b503 Use .toLowerCase() so casing does not need to be checked 2016-03-13 06:46:10 -04:00
Jose Diaz-Gonzalez
0616e77584 Update release notes regarding blockquotes 2016-03-13 06:45:11 -04:00
Jose Diaz-Gonzalez
6ed64724c0 Added yellow banner stating for doc release status
Also add the appropriate blockquote overrides in the template.html
2016-03-13 06:42:14 -04:00
Jose Diaz-Gonzalez
770c088507 Fix colors to be green
green == good to go, or released in a stable version.
2016-03-13 06:38:27 -04:00
Benjamin Kampmann
9af8389616 Highlight features that are yet to come
- Tone down "new as of version" boxes
 - Replace all "New as of 0.5" with "yet to be released" text
 - Use strong red only for "yet to be released" boxes

Fixes #1989
2016-03-13 11:30:14 +01:00
Jose Diaz-Gonzalez
7704175f0d Merge pull request #1981 from dokku/1220_mh-cleanup-dokku-label-containers
only remove containers with dokku label
2016-03-12 02:56:00 -05:00
Jose Diaz-Gonzalez
27ec5f0f6d Do not restart stopped processes on config:set/unset
Closes #1889
2016-03-12 02:21:53 -05:00
Jose Diaz-Gonzalez
900fcded9b Merge pull request #1985 from DNSFilter/master
Make history readable in github
2016-03-11 19:37:24 -05:00
Mike Schroll
9193e8c29d Make history readable in github 2016-03-11 18:15:04 -05:00
Michael Hobbs
ca2ff001a5 Merge pull request #1980 from dokku/1903_cu12-fix-dockerfile-vs-buildpack-environment-variable
(rebased) Fix issue when Dockerfile present but BUILDPACK_URL is set
2016-03-10 11:01:26 -05:00
Michael Hobbs
f810b5cd06 only remove containers with dokku label. closes #1220 2016-03-09 17:29:26 -05:00
Michael Hobbs
a91165d3e6 set DOKKU_APP_TYPE to IMAGE_SOURCE_TYPE value use in test case 2016-03-09 16:35:48 -05:00
Domonkos Czinke
1e3f29ad98 Fix issue when Dockerfile present but BUILDPACK_URL is set 2016-03-09 15:55:21 -05:00
Jose Diaz-Gonzalez
2f0e52abe1 Merge pull request #1979 from dokku/user-management-docs
Add specific documentation around user management. Closes #1978
2016-03-09 15:21:20 -05:00
Jose Diaz-Gonzalez
95eee5369d Add specific documentation around user management. Closes #1978
- Briefly cover sshcommand internals
- Show several examples for using sshcommand
- Split out docs onto a new page and relink to it where necessary
- Refer to user-auth plugin trigger for scoping commands to specific users.

[ci skip]
2016-03-09 15:20:59 -05:00
Jose Diaz-Gonzalez
e69b471134 Merge pull request #1963 from dokku/doc-fixes
Doc fixes
2016-03-08 21:36:57 -05:00
Jose Diaz-Gonzalez
cf77ee1d2a Cache the versions response in local storage to reduce network activity
[ci-skip]
2016-03-08 21:36:05 -05:00
Jose Diaz-Gonzalez
ec2a21c766 Better styling on menu item 2016-03-08 21:21:04 -05:00
Jose Diaz-Gonzalez
f385efbbfc Request a json file and set the proper cache-control header
[ci skip]
2016-03-08 21:05:44 -05:00
Jose Diaz-Gonzalez
8bf666f56d Add dynamic version menu
This will allow a user to browse the documentation as it was at any point in time. In doing so, this allows us to more easily deprecate/remove features without worrying about having to duplicate old documentation in the future.

[ci skip]
2016-03-08 21:05:44 -05:00
Jose Diaz-Gonzalez
173a87a53e Add link to slack group to readme
[ci skip]
2016-03-08 21:05:44 -05:00
Jose Diaz-Gonzalez
45c180368f Update issue template
- Add application name and contents of Procfile as required debug info
- Capitalize a few things

[ci skip]
2016-03-08 21:05:44 -05:00
Jose Diaz-Gonzalez
37bfdbbbe0 Note that deployment tasks are new as of 0.5.0
[ci skip]
2016-03-08 21:05:44 -05:00
Jose Diaz-Gonzalez
40e169043a Add link to 0.5.x migration guide
[ci skip]
2016-03-08 21:05:43 -05:00
Jose Diaz-Gonzalez
6eaa06f613 Note the location of the CHECKS file for dockerfile deploys. Closes #1962
[ci skip]
2016-03-08 21:05:43 -05:00
Jose Diaz-Gonzalez
d8c5b7f484 Update sidebar links
- Refer to checks plugin in zero-downtime deploy link
- Refer to cron in one off processes link
- Add an "Advanced Usage" section
  - Add links to proxy management and deployment tasks
  - Move container options and persistent storage to advanced usage

[ci skip]
2016-03-08 21:03:32 -05:00
Jose Diaz-Gonzalez
60cd04c36a Add reference to cron to one-off-processes doc
[ci skip]
2016-03-08 21:03:32 -05:00
Jose Diaz-Gonzalez
ede399e95c Add link to disabling nginx
[ci skip]
2016-03-08 21:03:32 -05:00
Jose Diaz-Gonzalez
b721661e2c Fix formatting in dokku-storage
[ci skip]
2016-03-08 21:03:32 -05:00
Jose Diaz-Gonzalez
4452fcda98 Properly note when 0.5.0 features were released
[ci skip]
2016-03-08 21:03:32 -05:00
Michael Hobbs
37584be044 Merge pull request #1953 from dokku/1579_mh-commands_refactor
subcommands/bashstyle refactor
2016-03-08 16:35:30 -05:00
Michael Hobbs
42520a6126 remove documentation of old plugin structure 2016-03-08 15:32:20 -05:00
Michael Hobbs
987c5cfb9c use declare for description variable 2016-03-08 15:30:34 -05:00
Jose Diaz-Gonzalez
ed98616b83 Merge pull request #1974 from unfold/broken-azure-installation-link
Update link in Azure installation instructions. Fixes #1973
2016-03-07 11:41:03 -05:00
Simen Brekken
19141460b5 Update link in Azure installation instructions. Fixes #1973 2016-03-07 16:59:25 +01:00
Michael Hobbs
d8e00f4f8a balance tests 2016-03-04 20:59:27 -08:00
Michael Hobbs
3bffba945a show timing for each bats file and overall test run 2016-03-04 20:59:17 -08:00
Michael Hobbs
4204d210c1 port --app syntax to dokku_client. closes #1638 2016-03-04 12:38:23 -08:00
Michael Hobbs
62731aa434 support parallel tests on same host 2016-03-03 22:11:35 -08:00
Michael Hobbs
7dd8d635bc show container type when printing container output 2016-03-03 22:11:35 -08:00
Michael Hobbs
718b129041 allow overriding of vagrant cpus 2016-03-03 22:11:35 -08:00
Michael Hobbs
3aa8bbd629 move standard commands into subcommands 2016-03-03 22:11:35 -08:00
Michael Hobbs
aa2415eeb8 more style/function tweaks 2016-03-03 22:11:35 -08:00
Michael S. Hobbs
89f289b433 subcommand restructure and bashstyle refactor. closes #1579 2016-03-03 22:11:35 -08:00
Jose Diaz-Gonzalez
76e27f0333 Add support for --app flag. Refs #1638
This change sets a DOKKU_APP_NAME env var, which can be used by plugins as a replacement for the `app` param if specified. Note that each plugin will have to manually shift it's arguments if necessary
2016-03-03 22:11:35 -08:00
Jose Diaz-Gonzalez
a35e690a62 Merge pull request #1959 from dokku/1942-dokku-port
Allow customizing ssh port for the default client
2016-03-03 17:24:38 -05:00
Jose Diaz-Gonzalez
8a4926515b Merge pull request #1965 from trevorturk/checks-example-tweaks-2
Checks example tweaks 2
2016-03-03 14:18:13 -05:00
Trevor Turk
bd5a7dea3a Checks doc: standardize spacing on check instruction example lines 2016-03-03 12:50:22 -06:00
Trevor Turk
6a25c8b675 Checks doc: mention the ability to globally configure DOKKU_CHECKS_TIMEOUT (it looks like you can do this, but I'm not 100% sure) 2016-03-03 12:47:14 -06:00
Trevor Turk
2acd2c294a Checks doc: minor copy edits to use a consistent voice and sentence structure 2016-03-03 12:46:03 -06:00
Trevor Turk
b8c264f173 Checks doc: add an example for the simple check for the Rails deployment example 2016-03-03 12:32:15 -06:00
Trevor Turk
2df9bbeb83 Checks doc: clean up Rails example deployments a bit, add a note about WAIT, and change to from 5 to 10 since the default is 5 so using that variable wouldn't make sense 2016-03-03 12:28:13 -06:00
Trevor Turk
7d60e160ab Checks doc: fix typos 2016-03-03 12:25:56 -06:00
Trevor Turk
7d73f61cd3 Checks doc: add a section about disabling the default wait time when running multiple processes re #1964 2016-03-03 12:25:12 -06:00
Trevor Turk
9de5965dd1 Checks doc: combine and clean up redundant checks settings content 2016-03-03 12:22:59 -06:00
Trevor Turk
b92fe46387 Checks doc: move redundant content to the same spot for now 2016-03-03 11:31:56 -06:00
Trevor Turk
da1d362203 Checks doc: break checks instructions and checks settings into sub sections 2016-03-03 11:30:52 -06:00
Trevor Turk
93e8078a93 Checks doc: break CHECKS file explanation into bullet points for easier reading 2016-03-03 11:29:40 -06:00
Trevor Turk
f5ab02ac20 Checks doc: remove linebreak to match the formatting used elsewhere in this doc, remove stray empty line 2016-03-03 11:27:12 -06:00
Trevor Turk
78bb76249e Checks doc: combine redundant content into a single paragraph 2016-03-03 11:24:59 -06:00
Trevor Turk
405c23f2bd Checks doc: move redundant content to the same spot for now, add a bit of content to divide the single check and multi check examples 2016-03-03 11:22:39 -06:00
Trevor Turk
aeaf12a7a2 Checks doc: move settings explanation into its own section 2016-03-03 11:15:22 -06:00
Trevor Turk
85dab3b6ef Checks doc: move checks examples up so we're explaining the options in one place 2016-03-03 11:13:30 -06:00
Trevor Turk
fa018d3e8c Checks doc: mention dokku checks disable at the top, before we get into the custom checks explanation 2016-03-03 11:00:04 -06:00
Trevor Turk
80d2bf9e8f Checks doc: add a header before getting into the custom checks explanation 2016-03-03 10:42:54 -06:00
Trevor Turk
aabe456aa6 Checks doc: example for setting DOKKU_WAIT_TO_RETIRE for a single app 2016-03-03 10:41:42 -06:00
Trevor Turk
1848ea5d15 Checks doc: mention DOKKU_WAIT_TO_RETIRE at the top, before we get into custom checks and config 2016-03-03 10:40:31 -06:00
Trevor Turk
ec0306278e Checks doc: standardize use of <app> instead of APP for commands 2016-03-03 10:37:16 -06:00
Trevor Turk
ecc40c7ea3 Checks doc: example for setting DOKKU_DEFAULT_CHECKS_WAIT for a single app 2016-03-03 10:36:39 -06:00
Michael Hobbs
63fb33d03d Merge pull request #1958 from u2mejc/u2mejc-issue1957
Enable debug output for dokku global exports in trace
2016-03-02 20:07:06 -08:00
Jose Diaz-Gonzalez
3cbf2e0138 Merge pull request #1960 from dokku/1890-clarify-commands
Clarify which commands should be run where. Closes #1890
2016-03-02 22:11:15 -05:00
Jose Diaz-Gonzalez
9a1f8fb161 Clarify which commands should be run where. Closes #1890
[ci skip]
2016-03-02 22:10:48 -05:00
Jose Diaz-Gonzalez
a765789c4d Allow customizing ssh port for the default client
Closes #1942
2016-03-02 22:01:52 -05:00
Justin Clark
a0543dfccf enable debug output for dokku global exports in trace 2016-03-02 18:08:23 -08:00
Jose Diaz-Gonzalez
fb45f221b7 Merge pull request #1687 from u2mejc/u2mejc-nobackup
Deprecate and remove dokku backup plugin, replace with documentation.
2016-03-02 19:29:07 -05:00
Jose Diaz-Gonzalez
633e81848e Merge pull request #1830 from u2mejc/u2mejc-issue1820
Add core storage plugin to manage docker bind mounts
2016-03-02 19:28:45 -05:00
Justin Clark
84df69b387 Add core storage plugin to manage docker bind mounts [ci skip] 2016-03-02 16:09:50 -08:00
Justin Clark
86b4987588 Depreciate and remove dokku backup plugin, replace with documentation 2016-03-02 15:56:33 -08:00
Jose Diaz-Gonzalez
8c01fa8480 Merge pull request #1951 from znz/fix-typos
Fix typos
2016-03-01 00:01:56 -05:00
Kazuhiro NISHIYAMA
ccb74f968b Fix typos 2016-03-01 12:29:21 +09:00
Jose Diaz-Gonzalez
56e9b22e1c Merge pull request #1947 from basgys/master
plugins: add etcd to the list of plugins
2016-02-27 14:42:35 -05:00
Bastien
87d2196cde plugins: add etcd to the list of plugins 2016-02-27 17:47:56 +01:00
Jose Diaz-Gonzalez
fd059da29b Merge pull request #1918 from MorrisJobke/arch-linux
Adds support for ArchLinux as host OS
2016-02-25 01:26:06 -05:00
Jose Diaz-Gonzalez
95080fee69 Merge pull request #1938 from npazo/patch-1
Add information about Slack channel
2016-02-25 01:00:50 -05:00
Jose Diaz-Gonzalez
62b9748269 Merge pull request #1939 from pmclanahan/client-add-dokku-remote
(client) Add dokku git remote when specifying app name
2016-02-25 01:00:00 -05:00
Jose Diaz-Gonzalez
7d71521851 Merge pull request #1941 from cu12/fix-check-plugin-command
Fix issue with plugins having plugins command
2016-02-25 00:59:07 -05:00
Domonkos Czinke
ac5944ec79 Fix issue with plugins having plugins command 2016-02-24 23:44:19 +01:00
Paul McLanahan
1b6973665a (client) Add dokku git remote when specifying app name
Previously the client would only add the git remote
for you if it was generating a random name for you.
2016-02-24 12:17:23 -05:00
Nick Pazoles
a0ad88372f Add information about Slack channel 2016-02-23 18:24:20 -06:00
Morris Jobke
7a9cf8abb1 Adds support for ArchLinux as host OS
* fix rsyslog handling
* don't hardcode dokku path
* add documentation for ArchLinux package build
* add vagrant machine to run the ArchLinux specific steps
* add step in release process for ArchLinux
* enhance docs for easy ArchLinux steps
2016-02-24 00:02:06 +01:00
Michael Hobbs
a146849a58 Merge pull request #1936 from dokku/mh-shellcheck-cleanup
cleanup shellcheck SC2086
2016-02-23 09:03:24 -08:00
Michael Hobbs
d1b87bd7b7 cleanup shellcheck SC2086 2016-02-23 07:50:06 -08:00
Michael Hobbs
ff9bb2cbd7 Merge pull request #1935 from dokku/mh-remove-nginx-test
remove unnecessary nginx test
2016-02-22 12:43:20 -08:00
Michael Hobbs
9b8f002aa8 remove unnecessary nginx test 2016-02-22 11:18:57 -08:00
Jose Diaz-Gonzalez
42f2f6b334 Merge pull request #1934 from dokku/mh-docker-ps-output-cleanup
fix get_running_image_tag() with docker 1.10.x
2016-02-22 14:12:05 -05:00
Michael Hobbs
676e8782ed fix get_running_image_tag() with docker 1.10.x 2016-02-22 10:21:20 -08:00
Jose Diaz-Gonzalez
d125ec5230 Merge pull request #1931 from dokku/relative-doc-links
Standardize on "relative" doc links
2016-02-21 03:14:46 -05:00
Jose Diaz-Gonzalez
f7d85b41cc Standardize on "relative" doc links
This will allow us to weather any future repository movements

[ci skip]
2016-02-21 03:12:48 -05:00
Jose Diaz-Gonzalez
86f9ba3b34 Merge pull request #1925 from dokku/jg-better-bootstrap
Update bootstrap.sh
2016-02-20 18:42:03 -05:00
Michael Hobbs
a9de2994bf Merge pull request #1836 from dokku/1824_mh-app-json
support scripts.dokku. in app.json
2016-02-20 06:35:40 -08:00
Michael Hobbs
48f2dc074c support scripts.dokku in app.json. closes #1824 2016-02-19 13:29:42 -08:00
Jose Diaz-Gonzalez
a4bfb46d6d Update bootstrap.sh
This pr makes it slightly easier to support dockerfile installations

- "simplifies" the bootstrap process by dividing it into distinct chunks
- Allows specifying `--no-install-recommends` when a dockerfile installation is detected
- Uses functions everywhere
- Removes global variables where possible
- Fixes shellcheck issues
- Allows specifying debconf via the command-line

[ci skip]
2016-02-19 04:35:43 -05:00
Jose Diaz-Gonzalez
55a4cb3274 Merge pull request #1892 from dokku/mh-nginx-vhosts-rewrite
nginx-vhosts rewrite
2016-02-18 22:56:09 -05:00
Michael Hobbs
9842d7498b nginx-vhosts rewrite 2016-02-18 18:38:54 -08:00
Jose Diaz-Gonzalez
4404e145c0 Merge pull request #1924 from dokku/1915-support-procfile-for-dockerfile-deploy
Fix #1564: Use Procfile for process types in Dockerfile apps
2016-02-18 21:23:06 -05:00
Paul McLanahan
6a01abb905 Fix #1564: Use Procfile for process types in Dockerfile apps
* Document new Procfile feature
* Add and update tests
* Fix a typo in generate_scale_file (ref #1923)
2016-02-18 21:22:26 -05:00
Jose Diaz-Gonzalez
8e297cd38e Release 0.4.14 2016-02-18 18:52:53 -05:00
Michael Hobbs
9531a7afb7 Merge pull request #1923 from dokku/mh-typo-gen-scale-file
fix typo in generate_scale_file()
2016-02-17 14:57:07 -08:00
Michael Hobbs
5588357589 fix typo in generate_scale_file() 2016-02-17 13:03:43 -08:00
Jose Diaz-Gonzalez
b74a77ace0 Merge pull request #1922 from dokku/josegonzalez-patch-1
Link to our new ISSUE_TEMPLATE.md
2016-02-17 13:02:54 -05:00
Jose Diaz-Gonzalez
7cda485afe Link to our new ISSUE_TEMPLATE.md
Refs dear-github/dear-github#125

[ci skip]
2016-02-17 13:02:26 -05:00
Jose Diaz-Gonzalez
0cd1243e7a Merge pull request #1921 from dokku/josegonzalez-patch-1
Create ISSUE_TEMPLATE.md
2016-02-17 12:58:42 -05:00
Jose Diaz-Gonzalez
1f1d95b689 Create ISSUE_TEMPLATE.md
[ci skip]
2016-02-17 12:58:35 -05:00
Jose Diaz-Gonzalez
4f51432211 Merge pull request #1912 from mattberther/enter-non-tty
passing -i -t to docker exec only if tty present
2016-02-13 00:42:41 -05:00
Jose Diaz-Gonzalez
2b5397b639 Merge pull request #1913 from dokku/mh-one-off-docs
document appropriate crontab usage
2016-02-12 19:48:15 -05:00
Michael Hobbs
964c1ee983 [ci skip] document appropriate crontab usage 2016-02-12 16:36:30 -08:00
Matt Berther
a0253efc27 passing -i -t only if tty present 2016-02-12 16:44:44 -07:00
Jose Diaz-Gonzalez
111a93ad82 Merge pull request #1911 from 2mia/bugfix/git_url_plugin_install
bugfix: git url pattern
2016-02-12 12:18:39 -05:00
Mihai Iancu
c268fa840e bugfix: git url pattern
github git urls format is "git@...". `dokku plugin:install` command will fail due to format not being matched.
2016-02-12 18:07:57 +02:00
Jose Diaz-Gonzalez
8b8b689858 Merge pull request #1907 from dokku/mh-run-rm-container
fix dokku run --rm regression
2016-02-11 13:58:05 -05:00
Michael Hobbs
fae4d8b8bf fix dokku run --rm regression. add test. fixes #1906 2016-02-11 07:20:26 -08:00
Jose Diaz-Gonzalez
653dc1c518 Merge pull request #1901 from dokku/config-shebang
Add shebang to config/functions so editors see it as a shell script
2016-02-09 00:01:58 -05:00
Jose Diaz-Gonzalez
7c67350e15 Add shebang to config/functions so editors see it as a shell script 2016-02-08 23:30:36 -05:00
Jose Diaz-Gonzalez
5f8a9dc76c Merge pull request #1900 from dokku/josegonzalez-patch-1
Upgrade our CoC to 1.4 of the Contributor Covenant
2016-02-08 19:19:43 -05:00
Jose Diaz-Gonzalez
0f4774bf60 Upgrade our CoC to 1.4 of the Contributor Covenant
[ci skip]
2016-02-08 19:19:35 -05:00
Jose Diaz-Gonzalez
174b5b74ad Verify nginx configuration and toss away reload on failure
Refs #1880
2016-02-03 12:55:18 -05:00
Jose Diaz-Gonzalez
a6d79b20bd Add note that phases must be comma-separated sans spaces
Closes #1893

[ci skip]
2016-01-31 16:27:06 -05:00
Justin Clark
7031682d6a Merge pull request #1887 from u2mejc/u2mejc-issue1885
Fix <command>:help hangs for certs, enter, tags, tar
2016-01-29 11:21:05 -08:00
Jose Diaz-Gonzalez
0ddc4ba496 Merge pull request #1888 from u2mejc/u2mejc-issue1886
Remove brocken symlinks when using copyfiles
2016-01-27 14:44:16 -05:00
Justin Clark
05378f53db Remove brocken symlinks when using copyfiles 2016-01-26 18:59:20 -08:00
Justin Clark
c62e384b47 Fix <command>:help hangs for certs, enter, tags, tar 2016-01-26 18:44:24 -08:00
Jose Diaz-Gonzalez
d8a7450f6b Merge pull request #1883 from dokku/mh-plugn-list-version
show plugn version when listing plugins
2016-01-26 13:14:49 -05:00
Michael Hobbs
4cf87c50de [ci skip] show plugn version when listing plugins 2016-01-26 10:11:24 -08:00
Jose Diaz-Gonzalez
21d343b3ad Merge pull request #1882 from dokku/josegonzalez-patch-1
Add a note to warn users to peg to specific versions of buildpacks
2016-01-25 11:43:08 -05:00
Jose Diaz-Gonzalez
bfcf834b07 Add a note to warn users to peg to specific versions of buildpacks
This should avoid users blaming dokku for not realizing that multi-buildpacks by default will install latest if you don't peg to a version.

[ci skip]
2016-01-25 11:42:45 -05:00
Jose Diaz-Gonzalez
8a0b299af7 Release 0.4.13 2016-01-20 22:59:29 -05:00
Michael Hobbs
543642eb5f Merge pull request #1872 from kenips/support/better_logs_for_checks
Update log to better reflect what's going on with CHECKS
2016-01-18 17:48:22 -08:00
Ken Ip
bf1e9ddaee Update log to better reflect what's going on with CHECKS 2016-01-18 19:35:47 -05:00
Michael Hobbs
71351f1a02 Merge pull request #1871 from dokku/mh-support-bash-4.2
support bash 4.2 so we don't have to modify all plugin test envs
2016-01-17 22:01:33 -08:00
Michael Hobbs
33c6e56030 support bash 4.2 so we don't have to modify all plugin test envs 2016-01-17 18:29:49 -08:00
Jose Diaz-Gonzalez
a0e1416027 Release 0.4.12 2016-01-16 17:21:44 -05:00
Justin Clark
c79a43f38a Merge pull request #1870 from u2mejc/u2mejc-issue1869
Remove arg check from docker-options/functions, global var cleanup
2016-01-15 17:15:42 -08:00
Justin Clark
3630cc2a99 Remove arg check from docker-options/functions, remove another global var 2016-01-15 14:45:29 -08:00
Jose Diaz-Gonzalez
309cdc6ab6 Merge pull request #1868 from alessio/fix-events-help-screen
Prevent dokku to hang on events:help
2016-01-15 15:35:26 -05:00
Alessio Treglia
2b7e327e09 Prevent dokku to hang on events:help
Update events:help case against to Dokku 0.4's new help screen
handling.
2016-01-15 20:28:16 +00:00
Jose Diaz-Gonzalez
db300f06da Release 0.4.11 2016-01-14 19:59:11 -05:00
Jose Diaz-Gonzalez
a2b775af42 Merge pull request #1855 from jvanbaarsen/add-skip-keyfile
Add skip_keyfile option for deb package
2016-01-14 17:53:56 -05:00
Michael Hobbs
999cbc0739 Merge pull request #1864 from znz/no-longer-need-to-set-nullglob
no longer need to set nullglob
2016-01-14 08:12:37 -08:00
Jose Diaz-Gonzalez
eb9d659361 Merge pull request #1863 from znz/fix-a-typo
Fix a typo
2016-01-14 10:14:07 -05:00
Kazuhiro NISHIYAMA
99ce2fa51d no longer need to set nullglob 2016-01-14 23:34:03 +09:00
Kazuhiro NISHIYAMA
d3a6e39b4e Fix a typo 2016-01-14 23:30:10 +09:00
Michael Hobbs
bc00acb5ff Merge pull request #1848 from u2mejc/u2mejc_docker-options_functions
Move docker-options functions to functions file, rework phase_file_path
2016-01-13 11:28:00 -08:00
Justin Clark
9a966f6f08 Move docker-options functions to functions file, rework code 2016-01-13 10:48:52 -08:00
Michael Hobbs
34a5766ce3 Merge pull request #1862 from dokku/mh-update-circleci-bash
install bash 4.3.x on circleci
2016-01-12 20:12:04 -08:00
Michael Hobbs
be9ab06116 install bash 4.3.x on circleci 2016-01-12 18:58:43 -08:00
Jeroen van Baarsen
2a4155aefc Add skip_keyfile option for deb package
There are cases where we don't want the check for keyfile, this will add a
config option, that allows you to skip this particular check.

Fixes #1851

Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2016-01-12 17:11:13 +01:00
Jose Diaz-Gonzalez
4dde70abdc Merge pull request #1859 from dhinus/dhinus-patch-1
Fix command for debconf-set-selections
2016-01-12 08:06:05 -05:00
Francesco Negri
7eeb6a2b95 Fix command for debconf-set-selections 2016-01-12 13:00:06 +00:00
Jose Diaz-Gonzalez
6931c3df5a Merge pull request #1856 from madflow/docker-options-404
Fixed dead documentation link
2016-01-11 11:28:34 -05:00
madflow
0ad650fb91 Fixed dead documentation link 2016-01-11 17:04:46 +01:00
Jose Diaz-Gonzalez
72135f8fbf Merge pull request #1854 from fedosov/patch-1
Update year in footer (2013-2016)
2016-01-10 14:16:15 -05:00
Mikhail Fedosov
546522264e Update year in footer (2013-2016) 2016-01-10 22:03:23 +03:00
Jose Diaz-Gonzalez
353f96cb93 Merge pull request #1849 from floriangosse/fix-debian-log-user
Fix logrotate file for debian system
2016-01-09 08:01:48 -05:00
Florian Goße
7a72146e82 modify logrotate file if the distro is debian 2016-01-09 11:35:47 +01:00
Jose Diaz-Gonzalez
f3627d4f84 Merge pull request #1841 from dokku/1806_mh-nginx-build-config-no-deploy
don't build nginx config if the app has not been deployed
2016-01-08 20:03:27 -05:00
Michael Hobbs
d98ed122a6 Merge pull request #1844 from dokku/mh-named-containers
named-containers: handle multiple old containers and don't attempt to rename a dead container
2016-01-07 20:19:31 -08:00
Michael Hobbs
30be9b7959 Merge pull request #1845 from dokku/mh-update-node-test-apps
update nodejs in test apps
2016-01-07 20:19:14 -08:00
Michael Hobbs
8562afde38 disable debug on docker daemon to avoid additional IO 2016-01-07 19:43:56 -08:00
Michael Hobbs
09936b37fa update nodejs in test apps 2016-01-07 18:00:12 -08:00
Michael Hobbs
8051fb86e7 named-containers: handle multiple old containers and don't attempt to rename a dead container 2016-01-07 17:56:27 -08:00
Jose Diaz-Gonzalez
c29ae712f3 Merge pull request #1843 from sseemayer/master
Move let's encrypt plugin to official plugins
2016-01-07 15:26:37 -05:00
Stefan Seemayer
88b0fc5d22 Move let's encrypt plugin to official plugins 2016-01-07 21:22:11 +01:00
Michael Hobbs
889555bb43 fix typo with DOKKU_SKIP_CLEANUP 2016-01-07 10:34:40 -08:00
Michael Hobbs
50194e5923 don't build nginx config if the app has not been deployed. closes #1806 2016-01-07 10:25:47 -08:00
Michael Hobbs
bfecd3beb4 Merge pull request #1842 from dokku/mh-skip-cleanup-in-ci
skip cleanup in ci to speed up tests
2016-01-07 10:25:27 -08:00
Michael Hobbs
74fd7e22d0 skip cleanup in ci to speed up tests 2016-01-07 09:53:04 -08:00
Jose Diaz-Gonzalez
2b97d9d677 Merge pull request #1840 from alessio/fix-dokku-0.4-events
Append trailing slash '/' to $PLUGIN_DIR
2016-01-07 06:49:52 -05:00
Alessio Treglia
546010246c Append trailing slash '/' to $PLUGIN_DIR
This is to prevent find's misbehaviours which
lead events:list to output incorrent information.

Fixes #1839
2016-01-07 11:46:53 +00:00
Jose Diaz-Gonzalez
f002a662bd Merge pull request #1838 from Epigene/patch-1
Fixed typo
2016-01-07 06:25:15 -05:00
Augusts Bautra
fde47dfa80 Fixed typo 2016-01-07 13:21:43 +02:00
339 changed files with 10001 additions and 4646 deletions

1
.gitignore vendored
View File

@@ -1,7 +1,6 @@
.vagrant
.DS_Store
stack.tgz
build
tmp
*.deb
.ruby-version

View File

@@ -1,50 +1,74 @@
# Contributor Code of Conduct
# Contributor Covenant Code of Conduct
As contributors and maintainers of this project, and in the interest of
fostering an open and welcoming community, we pledge to respect all people who
contribute through reporting issues, posting feature requests, updating
documentation, submitting pull requests or patches, and other activities.
## Our Pledge
We are committed to making participation in this project a harassment-free
experience for everyone, regardless of level of experience, gender, gender
identity and expression, sexual orientation, disability, personal appearance,
body size, race, ethnicity, age, religion, or nationality.
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery
* Personal attacks
* Trolling or insulting/derogatory comments
* Public or private harassment
* Publishing other's private information, such as physical or electronic
addresses, without explicit permission
* Other unethical or unprofessional conduct
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
By adopting this Code of Conduct, project maintainers commit themselves to
fairly and consistently applying these principles to every aspect of managing
this project. Project maintainers who do not follow or enforce the Code of
Conduct may be permanently removed from the project team.
## Scope
This code of conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community.
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting a project maintainer at dokku@josediazgonzalez.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. Maintainers are
obligated to maintain confidentiality with regard to the reporter of an
incident.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at dokku@josediazgonzalez.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.3.0, available at
[http://contributor-covenant.org/version/1/3/0/][version]
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/3/0/
[version]: http://contributor-covenant.org/version/1/4/

View File

@@ -1,6 +1,7 @@
# How to contribute
Dokku loves to welcome your contributions. There are several ways to help out:
The Dokku project would love to welcome your contributions. There are
several ways to help out:
* Create an [issue](https://github.com/dokku/dokku/issues) on GitHub, if you
have found a bug
@@ -8,6 +9,8 @@ Dokku loves to welcome your contributions. There are several ways to help out:
* Write patches for open bug/feature issues, preferably with test cases
included
* Contribute to the [documentation](http://dokku.viewdocs.io/dokku/)
* Come up with new ways to show off our [lovely logo](https://avatars1.githubusercontent.com/u/13455795)
* Blog about different ways you are using dokku
There are a few guidelines that we need contributors to follow so that we have
a chance of keeping on top of things.
@@ -58,6 +61,7 @@ etc). Please include:
* The output of `free -m`
* The output of `docker version`.
* The output of `docker -D info`.
* The output of `sigil -v`.
* The output of `docker run --rm -ti gliderlabs/herokuish:latest herokuish version`
* The output of `dokku version`.
* The output of `dokku plugin`.
@@ -65,46 +69,7 @@ etc). Please include:
Please also include the steps required to reproduce the problem if possible and
applicable. This information will help us review and fix your issue faster.
**Issue Report Template**:
```
Description of problem:
Output of the following commands
- `uname -a`:
- `free -m`:
- `docker version`:
- `docker -D info`:
- `docker run -ti gliderlabs/herokuish:latest herokuish version`:
- `dokku version`:
- `dokku plugin`:
- `docker inspect CONTAINER_ID` (if applicable):
- `cat /home/dokku/<app>/nginx.conf` (if applicable):
- Output of failing dokku commands with `dokku trace on`
(BEWARE: `trace on` will print environment variables for some commands, be sure you're not exposing any sensitive information when posting issues):
Environment details (AWS, VirtualBox, physical, etc.):
How was dokku installed?:
How reproducible:
Steps to Reproduce:
1.
2.
3.
Actual Results:
Expected Results:
Additional info:
```
Our Issue Report Template is available [here](https://github.com/dokku/dokku/blob/master/ISSUE_TEMPLATE.md)
## Contributing

View File

@@ -1,5 +1,394 @@
# History
## 0.6.2
This release is a minor bugfix for the web setup, and also reverts a previous addition to the persistent storage. Please see the pull requests for more details.
Thanks to all the contributors who helped with this release!
### Bug Fixes
- #2256: @michaelshobbs Revert automatically binding storage mounts in build phase
- #2259: @andrewsomething Don't run DeleteInstallerThread() until after set_debconf_selection
## 0.6.1
This release is a minor bugfix to fix an issue with ssl support for spdy-enabled nginx servers. Users are encouraged to upgrade if they have an older version of nginx installed.
### Bug Fixes
- #2250: @michaelshobbs Fix missing $ sign in default nginx template
## 0.6.0
The big-six-o. This release is largely comprised of new features that should allow for easier management of dokku. The highlights of this release are:
- The proxy plugin has been enhanced to allow users to map container ports to host ports. In the 0.5.0 release, we changed the semantics of how Dockerfile `EXPOSE` calls work to better follow Docker's lead, which ended up breaking how some applications were deployed to dokku. Please read our documentation surrounding [port management](http://dokku.viewdocs.io/dokku/proxy/) for more details.
- Zero-downtime deploys can be disabled on a per-app and per-process basis. This can be used to speed up deploys when there are non-web processes being deployed, or when a user wishes to completely avoid any such waiting period. Please see the [checks documentation](http://dokku.viewdocs.io/dokku/checks-examples/) for further information.
Thanks to all the contributors who helped with this release, and a special thanks to @michaelshobbs for ferrying the majority of our new functionality to it's current state!
### Bug Fixes
- #2241: @josegonzalez Set debconf selections from dokku-installer.py
- #2242: @michaelshobbs Avoid calling dokku binary
- #2243: @josegonzalez Nginx 1.9.5+ support
### New Features
- #2018: @pascalw Support running Procfile commands using `dokku run`
- #2050: @josegonzalez Implement repo:gc and repo:purge-cache
- #2109: @josegonzalez Allow user to modify the repository and tag when deploying an app
- #2168: @michaelshobbs Allow zero-downtime deploys to be completely disabled
- #2248: @michaelshobbs Allow users to map container ports to host ports via the proxy plugin
### Documentation
- #2209: @piamancini Added backers and sponsors from OpenCollective
- #2244: @basgys Add InfluxDB to plugins
## 0.5.8
This release is the last release in the `0.5.x` series, and as such is mainly a bugfix release. Users are highly encouraged to upgrade to this release *before* moving to the upcoming `0.6.x` release, as we will be removing deprecated features at that point.
Thanks to all the contributors who helped with this release!
### Bug Fixes
- #2214: @michaelshobbs Remove git push from client
- #2220: @josegonzalez Remove DOKKU_PROCFILE before attempting to extract it
- #2227: @michaelshobbs Pass image tag from release_and_deploy down through extract_procfile
- #2228: @michaelshobbs Support WORKDIR location for DOKKU_SCALE
- #2229: @hansmi Fix removal of domains with schema
- #2234: @michaelshobbs Cleanup container state files when a process type is removed from app
- #2236: @michaelshobbs Hide unnecessary output from is_image_herokuish_based()
- #2233: @josegonzalez Lintian cleanup
### New Features
- #2205: @josegonzalez Fix lintian errors in built debian packages
- #2223: @josegonzalez De-duplicate nginx restarting
- #2237: @michaelshobbs Reject invalid domains in domains:add
- #2238: @michaelshobbs Mount storage mounts on build for buildpack deploys
### Documentation
- #2212: @jbothma Warn and instruct users about unsafe publicly-accessible web installer
- #2222: @michaelshobbs Move nginx upstream blocks to the bottom in docs examples
## 0.5.7
0.5.7 includes quite a few documentation updates, and a few minor changes in how we handle certain edge-cases in day-to-day dokku tasks.
Thanks to all the contributors who helped with this release!
### Bug Fixes
- #2157: @michaelshobbs test detached container is running
- #2170: @jvanbaarsen Do not fail domains:add when adding a duplicated domain
- #2171: @tobru Continue to restore applications during boot when any given application does not start
- #2173: @michaelshobbs Add test for ps:restore with undeployed app
- #2202: @michaelshobbs Attempt to bypass inconsistencies in nginx start behavior
### New Features
- #2155: @josegonzalez Add the ability to run containers in detached mode
- #2163: @michaelshobbs Support deployment of arbitrary docker images not built by dokku build
- #2175: @michaelshobbs Show available types and ids on dokku enter error
- #2193: @josegonzalez Upgrade herokuish version built via deb packaging
- #2203: Allow specifying NO_INSTALL_RECOMMENDS via DOKKU_NO_INSTALL_RECOMMENDS in bootstrapped installs
### Documentation
- #2164: @iloveitaly Adding longtimeout and hostname to dokku plugin list
- #2167: @iloveitaly Adding link to rollbar plugin
- #2182: @cu12 Add link to FakeSNS plugin
- #2183: @Epigene Update nginx docs to mirror generated nginx.conf from core
- #2187: @pltchuong Add missing trigger to plugin triggers documentation
- #2190: @cu12 Add ElasticMQ plugin to documentation
- #2191: @josegonzalez Clarify upgrade docs for bootstrap.sh installations
- #2192: @josegonzalez Clarify that the checks are only run against the web process
- #2194: @josegonzalez Clarify the role of process types for buildpack deployment
- #2195: @josegonzalez Clarify when certain plugin triggers are invoked
## 0.5.6
Release 0.5.6 is mostly a documentation release. Please note, however, that we now inject application environment variables into sigil-generated nginx configurations. You can use this to further improve your generated nginx configuration files.
Thanks to all the contributors who helped with this release!
### Bug Fixes
- #2120: @u2mejc Add apex help_content for certs,nginx,storage,tar plugins
- #2122: @michaelshobbs Add 10.0.0.2 so *.dokku.me works
- #2145: @michaelshobbs Fix dockerfile-procfile test
### New Features
- #2150: @michaelshobbs export app config vars into sigil environment for use in nginx templates
### Documentation
- #2099: @ojosdegris Added clarification on configuration via separate files
- #2107: @simenbrekken Add CI deployment recipe
- #2112: @josegonzalez Alphabetize triggers
- #2114: @josegonzalez Add table of contents to sidebar when there is a table of contents
- #2115: @josegonzalez Document potential dockerfile/nginx.conf.sigil issues
- #2116: @josegonzalez Warn users when there is a low memory condition on installation
- #2127: @crisward Added dokku require plugin
- #2129: @christiangenco Condense upgrading instructions
- #2136: @josegonzalez Use `sleep infinity` for enter cron task
- #2142: @Aluxian Add dokku-nginx-cache to the list of plugins
## 0.5.5
Release 0.5.5 is mostly a documentation release, further clarifying how our default proxy implementation (nginx) interacts with Dockerfiles. Note that we also updated how ssl certificates interact with application domains, so please check out our domains and ssl documentation.
We've also added a small section to the [dokku homepage](http://dokku.viewdocs.io/dokku/) that lists the current core team. Feel free to look at their beautiful faces and imagine yourself contributing to Dokku and joining our core team. There are [quite a few ways to contribute](https://github.com/dokku/dokku/blob/master/CONTRIBUTING.md) - even without code/documentation - so feel more than free to jump on the bandwagon!
Finally, we've started an [Official Dokku Blog](https://dokku.github.io/), where we will post about dokku internals, roadmaps, potential use-cases, etc. An rss feed is available [here](https://dokku.github.io/feed.xml).
Thanks to all the contributors who helped with this release!
### Bug Fixes
- #2094: @josegonzalez Create storage directories on install. Closes #2091
- #2102: @josegonzalez Only strip .git directory from end of url
### New Features
- #2088: @josegonzalez Upgrade herokuish package
- #2089: @michaelshobbs Update how ssl and multiple domains interact
### Documentation
- #2076: @josegonzalez Add a note to dockerfile deploys concerning ports being exposed as http
- #2080: @michaelshobbs Clarify the need for contents of dockerfile when debugging
- #2082: @michaelshobbs Add use case example for ssl redirect
- #2083: @louisbl Clarify 0.5.0 migration guide about `EXPOSE`
- #2084: @louisbl Clarify where to put nginx custom template without `WORKDIR`
- #2093: @fwolfst Fix path in storage example
- #2098: @josegonzalez Add a blog link to the header area
- #2100: @kane-c Fix docs navigation link to domain configuration
- #2104: @crisward Added new clone plugin
- #2105: @josegonzalez Add a note about how disabling the proxy affects the host port an application is deployed to
## 0.5.4
This release continues on our tradition of making bugfixes in patch releases. Also note that we now release dokku with `sshcommand` version `0.4.0`, which should increase usability of that package quite a bit.
Thanks to all the contributors who helped with this release!
### Bug Fixes
- #2055: @tobru Move nginx include to server section
- #2060: @michaelshobbs Filter restart policies from exec-app-json containers
- #2061: @znz Fix ignored settings in the CHECKS file
- #2065: @michaelshobbs Fix pre/post deploy support for dockerfile apps
### New Features
- #2052: @josegonzalez Use upstream releases when creating deb packages. Closes #2048
- #2068: @josegonzalez Use latest sshcommand when installing via debian
- #2070: @josegonzalez Upgrade sshcommand to 0.4.0
### Documentation
- #2049: @mmlkrx Fix typo in deployment-tasks.md
- #2051: @plieningerweb Clarify installation instructions in docs
- #2058: @michaelshobbs Remove references to global TLS certs
- #2072: @michaelshobbs Note that we only support one EXPOSE port per line in dockerfiles
## 0.5.3
This release sorts out a few minor bugs introduced in the 0.5.0 release.
Thanks to all the contributors who helped with this release!
### Bug Fixes
- #2030: @josegonzalez Fix setting of APPS in checks command when $1 is left unspecified
- #2035: @stesie Fix ps_restart to not exit early
- #2042: @michaelshobbs Ensure CHECKS file has trailing newline
- #2046: @michaelshobbs Strip inline comments and trailing whitespace from CHECKS and Procfile
- #2047: @michaelshobbs Remove deprecated mktemp args and name vars more clearly
### Documentation
- #2032: @josegonzalez Fix upstream positioning in docs. Closes #2031
- #2039: @christiangenco Clarify upgrading documentation
- #2043: @michaelshobbs Clarify dockerfile port exposure documentation
- #2045: @u2mejc Reword dockerfiles docs to clarify EXPOSE handling in 0.5.x
## 0.5.2
This is a packaging fix release.
### Bug Fixes
- #2027: @michaelshobbs Add sigil to debian control file
## 0.5.1
That was quick! This is a bugfix release to fix issues in the packaging and release phases of dokku.
### Bug Fixes
- #2023: @josegonzalez Fix sigil packaging
- #2024: @josegonzalez Delete bad symlinks without confirmation
## 0.5.0
This is our largest, most feature-packed release in the history of the dokku project. Lots of delicious things, including:
- Support for docker 1.10/1.11. You *must* have docker 1.9.1+ to install dokku.
- Revamped documentation website
- [Deployment Tasks](http://dokku.viewdocs.io/dokku/deployment/deployment-tasks/)
- Heroku-style management of [dockerfile processes](http://dokku.viewdocs.io/dokku/deployment/dockerfiles/#procfiles-and-multiple-processes)
- Official [persistent storage plugin](http://dokku.viewdocs.io/dokku/dokku-storage/)
We'd also love it if you welcomed a few new core developers:
- @MorrisJobke: Maintainer of our new arch linux support
- @u2mejc: Contributed the help refactor and persistent storage plugins
Thanks to all the contributors who helped with this release!
## Refactor
- #1892: @michaelshobbs Refactor nginx proxy plugin to add usage flexibility
- #1925: @josegonzalez Simplify bootstrap.sh installation method
- #1953: @michaelshobbs Refactor commands into subcommands and add support for --app argument
- #1983: @u2mejc Collapse help into expandable command topics
- #1936: @michaelshobbs Cleanup shellcheck SC2086
### Bug Fixes
- #1934: @michaelshobbs Fix get_running_image_tag() with docker 1.10.x
- #1935: @michaelshobbs Remove unnecessary nginx test
- #1941: @cu12 Fix issue with plugins having plugins command
- #1980: @cu12 Fix issue when Dockerfile present but BUILDPACK_URL is set
- #1991: @MorrisJobke Only chown of existing files
- #1993: @istarkov Fix bash incorrect test command
- #2006: @baob Fix too many redirects
- #2012: @michaelshobbs minor bug fixes around app.json and docker-options
### New Features
- #1830: @u2mejc Add core storage plugin to manage docker bind mounts
- #1836: @michaelshobbs Support scripts.dokku. in app.json
- #1918: @MorrisJobke Adds support for ArchLinux as host OS
- #1924: @pmclanahan Use Procfile for process types in Dockerfile apps
- #1939: @pmclanahan Add dokku git remote when specifying app name in bash client
- #1958: @u2mejc Enable debug output for dokku global exports in trace
- #1959: @josegonzalez Allow customizing ssh port for the default client
- #1981: @josegonzalez Only remove containers with dokku label
- #1987: @josegonzalez Do not restart stopped processes on config:set/unset
### Documentation
- #1687: @u2mejc Deprecate and remove dokku backup plugin, replace with documentation.
- #1931: @josegonzalez Standardize on "relative" doc links
- #1938: @npazo Add information about Slack channel
- #1947: @basgys Add etcd to the list of plugins
- #1951: @znz Fix typos
- #1960: @josegonzalez Clarify which commands should be run where. Closes #1890
- #1963: @josegonzalez Add floating sidebar on documentation linking to released versions
- #1965: @trevorturk Clarify checks documentation
- #1974: @simenbrekken Update link in Azure installation instructions. Fixes #1973
- #1979: @josegonzalez Add specific documentation around user management. Closes #1978
- #1985: @MikeSchroll Make history readable in github
- #1990: @ligthyear Highlight features that are yet to come
- #1992: @Sureiya Improved documentation for using official dokku_client.sh
- #2000: @iamale Add dokku-monorepo to the plugin list in docs
- #2002: @michaelshobbs clarify deployment tasks are supported in both buildpack and dockerfile apps
- #2003: @michaelshobbs Add more useful post-deploy task and make blockquote
- #2004: @josegonzalez Document 0.5.x container removal strategy. Closes #1982
- #2007: @josegonzalez Document when configuration variables are available. Closes #1860
- #2009: @samholmes1337 Clarify purpose and potential penalties of primary vhost
- #2011: @josegonzalez Updated installation docs
- #2013: @michaelshobbs Make help desc local consistent
## 0.4.14
Hah you got us. We have to ship another 0.4.x release to fix issues with
running commands via `dokku run`. For quite a few releases, we've been
ignoring the `--rm` flag, meaning containers were lying around if you were
using `dokku run` in cron. This release fixes it, and is important enough
to warrant a 0.4.x release.
Thanks to all the contributors who helped with this release!
### Bug Fixes
- #1888: @u2mejc Remove broken symlinks when using copyfiles
- #1887: @u2mejc Fix <command>:help hangs for certs, enter, tags, tar
- #1901: @josegonzalez Add shebang to config/functions so editors see it as a shell script
- #1907: @michaelshobbs Fix dokku run --rm regression
- #1911: @2mia Add support for github url patterns when installing plugins
- #1912: @mattberther Pass -i -t to docker exec only if tty present
- #1923: @michaelshobbs Fix typo in generate_scale_file()
### Documentation
- #1882: @josegonzalez Add a note to warn users to peg to specific versions of buildpacks
- #1883: @michaelshobbs Show plugn version when listing plugins
- #1900: @josegonzalez Upgrade our CoC to 1.4 of the Contributor Covenant
- #1913: @michaelshobbs document appropriate crontab usage
- #1921: @josegonzalez Create ISSUE_TEMPLATE.md
- #1922: @josegonzalez Link to our new ISSUE_TEMPLATE.md
## 0.4.13
We lied. *This* is the final 0.4.x release. This specific release fixes support for bash `4.2`, which may be the only bash version available for certain testing environments.
Thanks to all the contributors who helped with this release!
### Bug Fixes
- #1871: @michaelshobbs Support bash 4.2 so we don't have to modify all plugin test envs
- #1872: @kenips Update log to better reflect what's going on with CHECKS
## 0.4.12
This is a small bugfix release, which will be the final release before the 0.5.x line. You can follow along on bugs/features we hope to cleanup for 0.5.x [here](https://github.com/dokku/dokku/milestones/v0.5.0).
Thanks to all the contributors who helped with this release!
### Bug Fixes
- #1868: @alessio Prevent dokku to hang on events:help
- #1870: @u2mejc Remove arg check from docker-options/functions, global var cleanup
## 0.4.11
Thanks to all the contributors who helped with this release!
### Bug Fixes
- #1840: @alessio Append trailing slash '/' to $PLUGIN_DIR
- #1841: @michaelshobbs Don't build nginx config if the app has not been deployed
- #1844: @michaelshobbs Handle multiple old containers and don't attempt to rename a dead container
- #1845: @michaelshobbs Update nodejs in test apps
- #1849: @floriangosse Fix logrotate file for debian system
- #1862: @michaelshobbs Install bash 4.3.x on circleci
- #1863: @znz Fix a typo in IPV6 detection
### New Features
- #1842: @michaelshobbs skip cleanup in ci to speed up tests
- #1848: @u2mejc Move docker-options functions to functions file, rework phase_file_path
- #1855: @jvanbaarsen Add skip_keyfile option for deb package
- #1864: @znz Remove nullglob from ps commands
### Documentation
- #1838: @Epigene Fixed typo in installation documentation
- #1843: @sseemayer Move let's encrypt plugin to official plugins
- #1854: @fedosov Update year in footer (2013-2016)
- #1856: @madflow Fixed dead documentation link
- #1859: @dhinus Fix command for debconf-set-selections
## 0.4.10
This release is mostly a bugfix release, though we have a few important changes:
@@ -22,8 +411,8 @@ Thanks to all the contributors who helped with this release!
### New Features
- #1826: @michaelshobbs Implement plugn update
- #1829: @michaelshobbs Implement dokku report command
- #1828: @michaelshobbs Label all dokku-managed containers
- #1829: @michaelshobbs Implement dokku report command
### Documentation

45
ISSUE_TEMPLATE.md Normal file
View File

@@ -0,0 +1,45 @@
Description of problem:
Output of the following commands
- `uname -a`:
- `free -m`:
- `docker version`:
- `docker -D info`:
- `sigil -v`:
- `docker run -ti gliderlabs/herokuish:latest herokuish version`:
- `dokku version`:
- `dokku plugin`:
- `docker inspect CONTAINER_ID` (if applicable):
(BEWARE: `docker inspect` will print environment variables for some commands, be sure you're not exposing any sensitive information when posting issues. You may replace these values with XXXXXXX):
- `cat /home/dokku/<app>/nginx.conf` (if applicable):
- Link to the exact repository being deployed (if possible/applicable):
- If a deploy is failing or behaving unexpectedly:
- Application name
- The type of application being deployed (node, php, python, ruby, etc.)
- If using buildpacks, which custom buildpacks are in use
- If using a `Dockerfile`, the contents of that file
- If it exists, the contents of your `Procfile`.
- Output of failing dokku commands after running `dokku trace on`
(BEWARE: `trace on` will print environment variables for some commands, be sure you're not exposing any sensitive information when posting issues. You may replace these values with XXXXXXX):
Environment details (AWS, VirtualBox, physical, etc.):
How was dokku installed?:
How reproducible:
Steps to Reproduce:
1.
2.
3.
Actual Results:
Expected Results:
Additional info:

View File

@@ -1,7 +1,8 @@
DOKKU_VERSION = master
SSHCOMMAND_URL ?= https://raw.githubusercontent.com/dokku/sshcommand/master/sshcommand
SSHCOMMAND_URL ?= https://raw.githubusercontent.com/dokku/sshcommand/v0.4.0/sshcommand
PLUGN_URL ?= https://github.com/dokku/plugn/releases/download/v0.2.1/plugn_0.2.1_linux_x86_64.tgz
SIGIL_URL ?= https://github.com/gliderlabs/sigil/releases/download/v0.4.0/sigil_0.4.0_Linux_x86_64.tgz
STACK_URL ?= https://github.com/gliderlabs/herokuish.git
PREBUILT_STACK_URL ?= gliderlabs/herokuish:latest
DOKKU_LIB_ROOT ?= /var/lib/dokku
@@ -26,6 +27,7 @@ endif
include tests.mk
include deb.mk
include arch.mk
all:
# Type "make install" to install.
@@ -56,13 +58,14 @@ copyfiles:
rm -rf ${PLUGINS_PATH}/$$plugin && \
cp -R plugins/$$plugin ${CORE_PLUGINS_PATH}/available && \
ln -s ${CORE_PLUGINS_PATH}/available/$$plugin ${PLUGINS_PATH}/available; \
find /var/lib/dokku/ -xtype l -delete;\
PLUGIN_PATH=${CORE_PLUGINS_PATH} plugn enable $$plugin ;\
PLUGIN_PATH=${PLUGINS_PATH} plugn enable $$plugin ;\
done
chown dokku:dokku -R ${PLUGINS_PATH} ${CORE_PLUGINS_PATH}
chown dokku:dokku -R ${PLUGINS_PATH} ${CORE_PLUGINS_PATH} || true
$(MAKE) addman
addman:
addman: help2man
mkdir -p /usr/local/share/man/man1
help2man -Nh help -v version -n "configure and get information from your dokku installation" -o /usr/local/share/man/man1/dokku.1 dokku
mandb
@@ -76,7 +79,7 @@ plugin-dependencies: plugn
plugins: plugn docker
sudo -E dokku plugin:install --core
dependencies: apt-update sshcommand plugn docker help2man man-db
dependencies: apt-update sshcommand plugn docker help2man man-db sigil
$(MAKE) -e stack
apt-update:
@@ -97,6 +100,10 @@ plugn:
wget -qO /tmp/plugn_latest.tgz ${PLUGN_URL}
tar xzf /tmp/plugn_latest.tgz -C /usr/local/bin
sigil:
wget -qO /tmp/sigil_latest.tgz ${SIGIL_URL}
tar xzf /tmp/sigil_latest.tgz -C /usr/local/bin
docker: aufs
apt-get install -qq -y curl
egrep -i "^docker" /etc/group || groupadd docker
@@ -149,4 +156,3 @@ vagrant-acl-add:
vagrant-dokku:
vagrant ssh -- "sudo -H -u root bash -c 'dokku $(RUN_ARGS)'"

View File

@@ -1,6 +1,9 @@
# Dokku [![Build Status](https://img.shields.io/circleci/project/dokku/dokku/master.svg?style=flat-square "Build Status")](https://circleci.com/gh/dokku/dokku/tree/master) [![Ubuntu Package](https://img.shields.io/badge/package-ubuntu-brightgreen.svg?style=flat-square "Ubuntu Package")](https://packagecloud.io/dokku/dokku) [![IRC Network](https://img.shields.io/badge/irc-freenode-blue.svg?style=flat-square "IRC Freenode")](https://webchat.freenode.net/?channels=dokku) [![Documentation](https://img.shields.io/badge/docs-viewdocs-blue.svg?style=flat-square "Viewdocs")](http://dokku.viewdocs.io/dokku/) [![Gratipay](https://img.shields.io/gratipay/dokku.svg?style=flat-square)](https://gratipay.com/dokku/)
# Dokku [![Build Status](https://img.shields.io/circleci/project/dokku/dokku/master.svg?style=flat-square "Build Status")](https://circleci.com/gh/dokku/dokku/tree/master) [![Ubuntu Package](https://img.shields.io/badge/package-ubuntu-brightgreen.svg?style=flat-square "Ubuntu Package")](https://packagecloud.io/dokku/dokku) [![IRC Network](https://img.shields.io/badge/irc-freenode-blue.svg?style=flat-square "IRC Freenode")](https://webchat.freenode.net/?channels=dokku) [![Slack Group](https://img.shields.io/badge/irc-slack-blue.svg?style=flat-square "Slack Group")](https://glider-slackin.herokuapp.com/) [![Documentation](https://img.shields.io/badge/docs-viewdocs-blue.svg?style=flat-square "Viewdocs")](http://dokku.viewdocs.io/dokku/)
[![OpenCollective](https://opencollective.com/dokku/sponsors/badge.svg?style=flat-square)](#sponsors)
[![OpenCollective](https://opencollective.com/dokku/backers/badge.svg?style=flat-square)](#backers)
[![Gratipay](https://img.shields.io/gratipay/dokku.svg?style=flat-square)](https://gratipay.com/dokku/)
Docker powered mini-Heroku. The smallest PaaS implementation you've ever seen. Sponsored by our friends at [Deis](http://deis.io/).
Docker powered mini-Heroku. The smallest PaaS implementation you've ever seen.
## Requirements
@@ -10,8 +13,8 @@ Docker powered mini-Heroku. The smallest PaaS implementation you've ever seen. S
To install the latest stable release, you can run the following commands as a user that has access to `sudo`:
wget https://raw.githubusercontent.com/dokku/dokku/v0.4.10/bootstrap.sh
sudo DOKKU_TAG=v0.4.10 bash bootstrap.sh
wget https://raw.githubusercontent.com/dokku/dokku/v0.6.2/bootstrap.sh
sudo DOKKU_TAG=v0.6.2 bash bootstrap.sh
### Upgrading
@@ -33,7 +36,76 @@ While we may not merge your PR as is, they serve to start conversations and impr
## Sponsors
Dokku is currently sponsored by the enterprise grade, multi-host PaaS project [Deis](http://deis.io/).
See our list of past sponsors in the [SPONSORS](https://github.com/dokku/dokku/blob/master/SPONSORS) file.
Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/dokku#sponsor)]
<a href="https://opencollective.com/dokku/sponsor/0/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/dokku/sponsor/1/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/1/avatar.svg"></a>
<a href="https://opencollective.com/dokku/sponsor/2/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/dokku/sponsor/3/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/3/avatar.svg"></a>
<a href="https://opencollective.com/dokku/sponsor/4/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/4/avatar.svg"></a>
<a href="https://opencollective.com/dokku/sponsor/5/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/5/avatar.svg"></a>
<a href="https://opencollective.com/dokku/sponsor/6/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/6/avatar.svg"></a>
<a href="https://opencollective.com/dokku/sponsor/7/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/7/avatar.svg"></a>
<a href="https://opencollective.com/dokku/sponsor/8/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/dokku/sponsor/9/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/9/avatar.svg"></a>
<a href="https://opencollective.com/dokku/sponsor/10/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/10/avatar.svg"></a>
<a href="https://opencollective.com/dokku/sponsor/11/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/11/avatar.svg"></a>
<a href="https://opencollective.com/dokku/sponsor/12/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/12/avatar.svg"></a>
<a href="https://opencollective.com/dokku/sponsor/13/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/13/avatar.svg"></a>
<a href="https://opencollective.com/dokku/sponsor/14/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/14/avatar.svg"></a>
<a href="https://opencollective.com/dokku/sponsor/15/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/15/avatar.svg"></a>
<a href="https://opencollective.com/dokku/sponsor/16/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/16/avatar.svg"></a>
<a href="https://opencollective.com/dokku/sponsor/17/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/17/avatar.svg"></a>
<a href="https://opencollective.com/dokku/sponsor/18/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/18/avatar.svg"></a>
<a href="https://opencollective.com/dokku/sponsor/19/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/19/avatar.svg"></a>
<a href="https://opencollective.com/dokku/sponsor/20/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/20/avatar.svg"></a>
<a href="https://opencollective.com/dokku/sponsor/21/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/21/avatar.svg"></a>
<a href="https://opencollective.com/dokku/sponsor/22/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/22/avatar.svg"></a>
<a href="https://opencollective.com/dokku/sponsor/23/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/23/avatar.svg"></a>
<a href="https://opencollective.com/dokku/sponsor/24/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/24/avatar.svg"></a>
<a href="https://opencollective.com/dokku/sponsor/25/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/25/avatar.svg"></a>
<a href="https://opencollective.com/dokku/sponsor/26/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/26/avatar.svg"></a>
<a href="https://opencollective.com/dokku/sponsor/27/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/27/avatar.svg"></a>
<a href="https://opencollective.com/dokku/sponsor/28/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/28/avatar.svg"></a>
<a href="https://opencollective.com/dokku/sponsor/29/website" target="_blank"><img src="https://opencollective.com/dokku/sponsor/29/avatar.svg"></a>
## Backers
Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/dokku#backer)]
<a href="https://opencollective.com/dokku/backer/0/website" target="_blank"><img src="https://opencollective.com/dokku/backer/0/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/1/website" target="_blank"><img src="https://opencollective.com/dokku/backer/1/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/2/website" target="_blank"><img src="https://opencollective.com/dokku/backer/2/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/3/website" target="_blank"><img src="https://opencollective.com/dokku/backer/3/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/4/website" target="_blank"><img src="https://opencollective.com/dokku/backer/4/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/5/website" target="_blank"><img src="https://opencollective.com/dokku/backer/5/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/6/website" target="_blank"><img src="https://opencollective.com/dokku/backer/6/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/7/website" target="_blank"><img src="https://opencollective.com/dokku/backer/7/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/8/website" target="_blank"><img src="https://opencollective.com/dokku/backer/8/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/9/website" target="_blank"><img src="https://opencollective.com/dokku/backer/9/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/10/website" target="_blank"><img src="https://opencollective.com/dokku/backer/10/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/11/website" target="_blank"><img src="https://opencollective.com/dokku/backer/11/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/12/website" target="_blank"><img src="https://opencollective.com/dokku/backer/12/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/13/website" target="_blank"><img src="https://opencollective.com/dokku/backer/13/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/14/website" target="_blank"><img src="https://opencollective.com/dokku/backer/14/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/15/website" target="_blank"><img src="https://opencollective.com/dokku/backer/15/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/16/website" target="_blank"><img src="https://opencollective.com/dokku/backer/16/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/17/website" target="_blank"><img src="https://opencollective.com/dokku/backer/17/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/18/website" target="_blank"><img src="https://opencollective.com/dokku/backer/18/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/19/website" target="_blank"><img src="https://opencollective.com/dokku/backer/19/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/20/website" target="_blank"><img src="https://opencollective.com/dokku/backer/20/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/21/website" target="_blank"><img src="https://opencollective.com/dokku/backer/21/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/22/website" target="_blank"><img src="https://opencollective.com/dokku/backer/22/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/23/website" target="_blank"><img src="https://opencollective.com/dokku/backer/23/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/24/website" target="_blank"><img src="https://opencollective.com/dokku/backer/24/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/25/website" target="_blank"><img src="https://opencollective.com/dokku/backer/25/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/26/website" target="_blank"><img src="https://opencollective.com/dokku/backer/26/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/27/website" target="_blank"><img src="https://opencollective.com/dokku/backer/27/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/28/website" target="_blank"><img src="https://opencollective.com/dokku/backer/28/avatar.svg"></a>
<a href="https://opencollective.com/dokku/backer/29/website" target="_blank"><img src="https://opencollective.com/dokku/backer/29/avatar.svg"></a>
## License

21
Vagrantfile vendored
View File

@@ -2,6 +2,7 @@
# vi: set ft=ruby :
BOX_NAME = ENV["BOX_NAME"] || "bento/ubuntu-14.04"
BOX_CPUS = ENV["BOX_CPUS"] || "1"
BOX_MEMORY = ENV["BOX_MEMORY"] || "1024"
DOKKU_DOMAIN = ENV["DOKKU_DOMAIN"] || "dokku.me"
DOKKU_IP = ENV["DOKKU_IP"] || "10.0.0.2"
@@ -24,6 +25,7 @@ Vagrant::configure("2") do |config|
# Ubuntu's Raring 64-bit cloud image is set to a 32-bit Ubuntu OS type by
# default in Virtualbox and thus will not boot. Manually override that.
vb.customize ["modifyvm", :id, "--ostype", "Ubuntu_64"]
vb.customize ["modifyvm", :id, "--cpus", BOX_CPUS]
vb.customize ["modifyvm", :id, "--memory", BOX_MEMORY]
end
@@ -38,6 +40,13 @@ Vagrant::configure("2") do |config|
vm.vm.network :forwarded_port, guest: 80, host: FORWARDED_PORT
vm.vm.hostname = "#{DOKKU_DOMAIN}"
vm.vm.network :private_network, ip: DOKKU_IP
# Use the same nameserver as the host machine in order to avoid the "too many redirects" problem.
vm.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "off"]
vb.customize ["modifyvm", :id, "--natdnsproxy1", "off"]
end
vm.vm.provision :shell, :inline => "export DEBIAN_FRONTEND=noninteractive && apt-get update > /dev/null && apt-get -qq -y install git > /dev/null && cd /root/dokku && #{make_cmd}"
vm.vm.provision :shell, :inline => "cd /root/dokku && make dokku-installer"
vm.vm.provision :shell do |s|
@@ -73,7 +82,17 @@ Vagrant::configure("2") do |config|
vm.vm.hostname = "#{DOKKU_DOMAIN}"
vm.vm.network :private_network, ip: DOKKU_IP
vm.vm.provision :shell, :inline => "export DEBIAN_FRONTEND=noninteractive && apt-get update > /dev/null && apt-get -qq -y install git > /dev/null && cd /root/dokku && #{make_cmd}"
vm.vm.provision :shell, :inline => "cd /root/dokku && make deb-all"
vm.vm.provision :shell, :inline => "export IS_RELEASE=true && cd /root/dokku && make deb-all"
end
config.vm.define "build-arch", autostart: false do |vm|
vm.vm.box = "bugyt/archlinux"
vm.vm.synced_folder File.dirname(__FILE__), "/dokku"
vm.vm.synced_folder "#{File.dirname(__FILE__)}/../dokku-arch", "/dokku-arch"
vm.vm.network :forwarded_port, guest: 80, host: FORWARDED_PORT
vm.vm.hostname = "#{DOKKU_DOMAIN}"
vm.vm.network :private_network, ip: DOKKU_IP
vm.vm.provision :shell, :inline => "cd /dokku && make arch-all", privileged: false
end
if Pathname.new(PUBLIC_KEY_PATH).exist?

28
arch.mk Normal file
View File

@@ -0,0 +1,28 @@
.PHONY: arch-all arch-dokku
arch-all: arch-dokku
echo "Done"
arch-setup:
echo "-> Updating pacman repository and installing package helper"
sudo pacman -Sy
sudo pacman -S --needed --noconfirm pkgbuild-introspection
echo "-> Download, build and install cower (dependency of pacaur) and pacaur"
curl -so /tmp/cower.tar.gz https://aur.archlinux.org/cgit/aur.git/snapshot/cower.tar.gz
curl -so /tmp/pacaur.tar.gz https://aur.archlinux.org/cgit/aur.git/snapshot/pacaur.tar.gz
tar -xzf /tmp/cower.tar.gz -C /tmp
tar -xzf /tmp/pacaur.tar.gz -C /tmp
gpg --recv-key 1EB2638FF56C0C53
cd /tmp/cower; makepkg -sri --noconfirm
cd /tmp/pacaur; makepkg -sri --noconfirm
echo "-> Installing build requirements"
pacaur --noconfirm --noedit -S plugn
arch-dokku: arch-setup
echo "-> Update package sums, create metadata file and test the build of the package"
git describe --tags > /tmp/VERSION
cat /tmp/VERSION | cut -d '-' -f 1 | cut -d 'v' -f 2 > /tmp/STABLE_VERSION
sed -i -e "s/pkgver=.*/pkgver=`cat /tmp/STABLE_VERSION`/" /dokku-arch/PKGBUILD
cd /dokku-arch; updpkgsums; mksrcinfo; makepkg -fd

View File

@@ -1,55 +1,99 @@
#!/bin/bash
#
#!/usr/bin/env bash
set -eo pipefail; [[ $TRACE ]] && set -x
# A script to bootstrap dokku.
# It expects to be run on Ubuntu 14.04 via 'sudo'
# If installing a tag higher than 0.3.13, it may install dokku via a package (so long as the package is higher than 0.3.13)
# It checks out the dokku source code from Github into ~/dokku and then runs 'make install' from dokku source.
# We wrap this whole script in a function, so that we won't execute
# We wrap this whole script in functions, so that we won't execute
# until the entire script is downloaded.
# That's good because it prevents our output overlapping with wget's.
# It also means that we can't run a partially downloaded script.
ensure-environment() {
local FREE_MEMORY
echo "Preparing to install $DOKKU_TAG from $DOKKU_REPO..."
if ! command -v apt-get &>/dev/null; then
echo "This installation script requires apt-get. For manual installation instructions, consult http://dokku.viewdocs.io/dokku/advanced-installation/"
exit 1
fi
bootstrap () {
hostname -f > /dev/null 2>&1 || {
echo "This installation script requires that you have a hostname set for the instance. Please set a hostname for 127.0.0.1 in your /etc/hosts"
exit 1
}
set -eo pipefail
export DEBIAN_FRONTEND=noninteractive
export DOKKU_REPO=${DOKKU_REPO:-"https://github.com/dokku/dokku.git"}
echo "Preparing to install $DOKKU_TAG from $DOKKU_REPO..."
if ! command -v apt-get &>/dev/null; then
echo "This installation script requires apt-get. For manual installation instructions, consult http://dokku.viewdocs.io/dokku/advanced-installation/"
exit 1
fi
hostname -f > /dev/null 2>&1 || {
echo "This installation script requires that you have a hostname set for the instance. Please set a hostname for 127.0.0.1 in your /etc/hosts"
exit 1
FREE_MEMORY=$(grep MemTotal /proc/meminfo | awk '{print $2}')
if [[ "$FREE_MEMORY" -lt 1003600 ]]; then
echo "For dokku to build containers, it is strongly suggested that you have 1024 megabytes or more of free memory"
echo "If necessary, please consult this document to setup swap: http://dokku.viewdocs.io/dokku/advanced-installation/#vms-with-less-than-1gb-of-memory"
fi
}
echo "--> Ensuring we have the proper dependencies"
apt-get update -qq > /dev/null
[[ $(lsb_release -sr) == "12.04" ]] && apt-get install -qq -y python-software-properties
install-requirements() {
echo "--> Ensuring we have the proper dependencies"
apt-get update -qq > /dev/null
if [[ $(lsb_release -sr) == "12.04" ]]; then
apt-get -qq -y install python-software-properties
fi
}
dokku_install_source() {
apt-get install -qq -y git make software-properties-common
install-dokku() {
if [[ -n $DOKKU_BRANCH ]]; then
install-dokku-from-source "origin/$DOKKU_BRANCH"
elif [[ -n $DOKKU_TAG ]]; then
local DOKKU_SEMVER="${DOKKU_TAG//v}"
major=$(echo "$DOKKU_SEMVER" | awk '{split($0,a,"."); print a[1]}')
minor=$(echo "$DOKKU_SEMVER" | awk '{split($0,a,"."); print a[2]}')
patch=$(echo "$DOKKU_SEMVER" | awk '{split($0,a,"."); print a[3]}')
# 0.3.13 was the first version with a debian package
if [[ "$major" -eq "0" ]] && [[ "$minor" -eq "3" ]] && [[ "$patch" -ge "13" ]]; then
install-dokku-from-package "$DOKKU_SEMVER"
echo "--> Running post-install dependency installation"
dokku plugins-install-dependencies
# 0.4.0 implemented a `plugin` plugin
elif [[ "$major" -eq "0" ]] && [[ "$minor" -ge "4" ]] && [[ "$patch" -ge "0" ]]; then
install-dokku-from-package "$DOKKU_SEMVER"
echo "--> Running post-install dependency installation"
sudo -E dokku plugin:install-dependencies --core
else
install-dokku-from-source "$DOKKU_TAG"
fi
else
install-dokku-from-package
echo "--> Running post-install dependency installation"
sudo -E dokku plugin:install-dependencies --core
fi
}
install-dokku-from-source() {
local DOKKU_CHECKOUT="$1"
apt-get -qq -y install git make software-properties-common
cd /root
if [[ ! -d /root/dokku ]]; then
git clone $DOKKU_REPO /root/dokku
git clone "$DOKKU_REPO" /root/dokku
fi
cd /root/dokku
git fetch origin
git checkout $DOKKU_CHECKOUT
[[ -n $DOKKU_CHECKOUT ]] && git checkout "$DOKKU_CHECKOUT"
make install
}
dokku_install_package() {
install-dokku-from-package() {
local DOKKU_CHECKOUT="$1"
local NO_INSTALL_RECOMMENDS=${DOKKU_NO_INSTALL_RECOMMENDS:=""}
if [[ -n $DOKKU_DOCKERFILE ]]; then
NO_INSTALL_RECOMMENDS=" --no-install-recommends "
fi
echo "--> Initial apt-get update"
apt-get update -qq > /dev/null
apt-get install -qq -y apt-transport-https
apt-get -qq -y install apt-transport-https
echo "--> Installing docker"
if uname -r | grep -q linode; then
@@ -65,44 +109,28 @@ dokku_install_package() {
echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ trusty main" | tee /etc/apt/sources.list.d/dokku.list
apt-get update -qq > /dev/null
[[ -n $DOKKU_VHOST_ENABLE ]] && echo "dokku dokku/vhost_enable boolean $VHOST_ENABLE" | sudo debconf-set-selections
[[ -n $DOKKU_WEB_CONFIG ]] && echo "dokku dokku/web_config boolean $DOKKU_WEB_CONFIG" | sudo debconf-set-selections
[[ -n $DOKKU_HOSTNAME ]] && echo "dokku dokku/hostname string $DOKKU_HOSTNAME" | sudo debconf-set-selections
[[ -n $DOKKU_SKIP_KEY_FILE ]] && echo "dokku dokku/skip_key_file boolean $DOKKU_SKIP_KEY_FILE" | sudo debconf-set-selections
[[ -n $DOKKU_KEY_FILE ]] && echo "dokku dokku/key_file string $DOKKU_KEY_FILE" | sudo debconf-set-selections
if [[ -n $DOKKU_CHECKOUT ]]; then
apt-get install -y dokku=$DOKKU_CHECKOUT
# shellcheck disable=SC2086
apt-get -qq -y $NO_INSTALL_RECOMMENDS install "dokku=$DOKKU_CHECKOUT"
else
apt-get install -y dokku
# shellcheck disable=SC2086
apt-get -qq -y $NO_INSTALL_RECOMMENDS install dokku
fi
}
if [[ -n $DOKKU_BRANCH ]]; then
export DOKKU_CHECKOUT="origin/$DOKKU_BRANCH"
dokku_install_source
elif [[ -n $DOKKU_TAG ]]; then
export DOKKU_SEMVER="${DOKKU_TAG//v}"
major=$(echo $DOKKU_SEMVER | awk '{split($0,a,"."); print a[1]}')
minor=$(echo $DOKKU_SEMVER | awk '{split($0,a,"."); print a[2]}')
patch=$(echo $DOKKU_SEMVER | awk '{split($0,a,"."); print a[3]}')
# 0.3.13 was the first version with a debian package
if [[ "$major" -eq "0" ]] && [[ "$minor" -eq "3" ]] && [[ "$patch" -ge "13" ]]; then
export DOKKU_CHECKOUT="$DOKKU_SEMVER"
dokku_install_package
echo "--> Running post-install dependency installation"
dokku plugins-install-dependencies
# 0.4.0 implemented a `plugin` plugin
elif [[ "$major" -eq "0" ]] && [[ "$minor" -ge "4" ]] && [[ "$patch" -ge "0" ]]; then
export DOKKU_CHECKOUT="$DOKKU_SEMVER"
dokku_install_package
echo "--> Running post-install dependency installation"
sudo -E dokku plugin:install-dependencies --core
else
export DOKKU_CHECKOUT="$DOKKU_TAG"
dokku_install_source
fi
else
dokku_install_package
echo "--> Running post-install dependency installation"
sudo -E dokku plugin:install-dependencies --core
fi
main() {
export DEBIAN_FRONTEND=noninteractive
export DOKKU_REPO=${DOKKU_REPO:-"https://github.com/dokku/dokku.git"}
ensure-environment
install-requirements
install-dokku
}
bootstrap
main "$@"

View File

@@ -1,6 +1,6 @@
machine:
pre:
- echo 'DOCKER_OPTS="-s btrfs -e lxc -D --userland-proxy=false"' | sudo tee -a /etc/default/docker
- echo 'DOCKER_OPTS="-s btrfs -e lxc --userland-proxy=false"' | sudo tee -a /etc/default/docker
- sudo curl -L -o /usr/bin/docker 'https://s3-external-1.amazonaws.com/circle-downloads/docker-1.9.1-circleci-cp-workaround'
- sudo chmod 0755 /usr/bin/docker
services:
@@ -10,6 +10,9 @@ dependencies:
- "~/docker"
override:
- ./tests/ci/parallel_runner.sh setup: { timeout: 300 }
- echo "export DOKKU_SKIP_CLEANUP=true" > /home/dokku/.dokkurc/dokku_skip_cleanup
# dokku.me now resolves to 10.0.0.2. add 10.0.0.2/24 to eth0
- sudo ip a a 10.0.0.2/24 broadcast 10.0.0.255 dev eth0
post:
- sudo -E make -e lint
test:

View File

@@ -9,7 +9,7 @@ import subprocess
import sys
import threading
VERSION = 'v0.4.10'
VERSION = 'v0.6.2'
hostname = ''
try:
@@ -86,8 +86,10 @@ class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
'REQUEST_METHOD': 'POST',
'CONTENT_TYPE': self.headers['Content-Type']})
vhost_enable = 'false'
dokku_root = os.getenv('DOKKU_ROOT', '/home/dokku')
if 'vhost' in params and params['vhost'].value == 'true':
vhost_enable = 'true'
with open('{0}/VHOST'.format(dokku_root), 'w') as f:
f.write(params['hostname'].value)
else:
@@ -98,7 +100,6 @@ class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
with open('{0}/HOSTNAME'.format(dokku_root), 'w') as f:
f.write(params['hostname'].value)
command = ['sshcommand', 'acl-add', 'dokku', 'admin']
for key in params['keys'].value.split("\n"):
proc = subprocess.Popen(command, stdin=subprocess.PIPE)
@@ -106,6 +107,11 @@ class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
proc.stdin.close()
proc.wait()
set_debconf_selection('boolean', 'skip_key_file', 'true')
set_debconf_selection('boolean', 'vhost_enable', vhost_enable)
set_debconf_selection('boolean', 'web_config', 'false')
set_debconf_selection('string', 'hostname', params['hostname'].value)
if 'selfdestruct' in sys.argv:
DeleteInstallerThread()
@@ -114,6 +120,28 @@ class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
self.wfile.write(json.dumps({'status': 'ok'}))
def set_debconf_selection(debconf_type, key, value):
found = False
with open('/etc/os-release', 'r') as f:
for line in f:
if 'debian' in line:
found = True
if not found:
return
ps = subprocess.Popen(['echo', 'dokku dokku/{0} {1} {2}'.format(
key, debconf_type, value
)], stdout=subprocess.PIPE)
try:
subprocess.check_output(['debconf-set-selections'], stdin=ps.stdout)
except subprocess.CalledProcessError:
pass
ps.wait()
class DeleteInstallerThread(object):
def __init__(self, interval=1):
thread = threading.Thread(target=self.run, args=())

View File

@@ -41,6 +41,8 @@ if [[ -z $DOKKU_HOST ]]; then
fi
fi
export DOKKU_PORT=${DOKKU_PORT:=22}
if [[ ! -z $DOKKU_HOST ]]; then
_dokku() {
appname=""
@@ -52,76 +54,41 @@ if [[ ! -z $DOKKU_HOST ]]; then
echo "This is not a git repository"
fi
if [[ "$appname" != "" ]] && [[ -n "$*" ]]; then
case "$1" in
apps|backup*|help|plugins*|ps:restartall|trace|version)
true
;;
apps:destroy)
if [[ -z "$2" ]] || [[ "$2" == "force" ]]; then
donotshift="YES"
fi
;;
*)
donotshift="YES"
;;
esac
fi
if [[ "$1" = "apps:create" ]] && [[ -z "$2" ]]; then
appname=$(random_name)
counter=0
while ssh "dokku@$DOKKU_HOST" apps 2>/dev/null| grep -q "$appname"; do
if [[ $counter -ge 100 ]]; then
echo "Error: could not reasonably generate a new app name. try cleaning up some apps..."
ssh "dokku@$DOKKU_HOST" apps
exit 1
else
case "$1" in
apps:create)
if [[ -z "$2" ]]; then
appname=$(random_name)
counter=$((counter+1))
counter=0
while ssh -p "$DOKKU_PORT" "dokku@$DOKKU_HOST" apps 2>/dev/null| grep -q "$appname"; do
if [[ $counter -ge 100 ]]; then
echo "Error: could not reasonably generate a new app name. try cleaning up some apps..."
ssh -p "$DOKKU_PORT" "dokku@$DOKKU_HOST" apps
exit 1
else
appname=$(random_name)
counter=$((counter+1))
fi
done
else
appname="$2"
fi
done
if git remote add dokku "dokku@$DOKKU_HOST:$appname"; then
echo "-----> Dokku remote added at $DOKKU_HOST"
echo "-----> Application name is $appname"
else
echo "! Dokku remote not added! Do you already have a dokku remote?"
return
fi
git push dokku master
return $?
fi
if [[ -z "$donotshift" ]]; then
# shellcheck disable=SC2029
ssh -o LogLevel=QUIET -t "dokku@$DOKKU_HOST" "$@"
exit $?
fi
if [[ -z "$verb" ]]; then
if [[ ! "$1" =~ --* ]]; then
verb=$1
shift
if [[ "$1" == "$appname" ]]; then
shift
if git remote add dokku "dokku@$DOKKU_HOST:$appname"; then
echo "-----> Dokku remote added at $DOKKU_HOST"
echo "-----> Application name is $appname"
else
echo "! Dokku remote not added! Do you already have a dokku remote?"
return
fi
;;
apps:destroy)
git remote remove dokku
;;
esac
args="$*"
else
long_args="--"
for arg in "$@"; do
if [[ "$arg" =~ --* ]]; then
long_args+=" $arg"
args=("${args[@]/$arg}")
else
verb="$arg"
fi
done
fi
fi
# shellcheck disable=SC2086,SC2029
ssh -o LogLevel=QUIET -t "dokku@$DOKKU_HOST" $long_args "$verb" "$appname" "${args[@]}"
[[ -n "$@" ]] && [[ -n "$appname" ]] && app_arg="--app $appname"
# echo "ssh -o LogLevel=QUIET -p $DOKKU_PORT -t dokku@$DOKKU_HOST -- $app_arg $@"
# shellcheck disable=SC2068,SC2086
ssh -o LogLevel=QUIET -p $DOKKU_PORT -t dokku@$DOKKU_HOST -- $app_arg $@
}
if [[ "$0" == "dokku" ]] || [[ "$0" == *dokku_client.sh ]] || [[ "$0" == $(which dokku) ]]; then

205
deb.mk
View File

@@ -1,6 +1,6 @@
HEROKUISH_DESCRIPTION = 'Herokuish uses Docker and Buildpacks to build applications like Heroku'
HEROKUISH_REPO_NAME ?= gliderlabs/herokuish
HEROKUISH_VERSION ?= 0.3.8
HEROKUISH_VERSION ?= 0.3.13
HEROKUISH_ARCHITECTURE = amd64
HEROKUISH_PACKAGE_NAME = herokuish_$(HEROKUISH_VERSION)_$(HEROKUISH_ARCHITECTURE).deb
@@ -8,89 +8,119 @@ DOKKU_DESCRIPTION = 'Docker powered mini-Heroku in around 100 lines of Bash'
DOKKU_REPO_NAME ?= dokku/dokku
DOKKU_ARCHITECTURE = amd64
PLUGN_DESCRIPTION = 'Hook system that lets users extend your application with plugins'
define PLUGN_DESCRIPTION
Hook system that lets users extend your application with plugins
Plugin triggers are simply scripts that are executed by the system.
You can use any language you want, so long as the script is
executable and has the proper language requirements installed
endef
PLUGN_REPO_NAME ?= dokku/plugn
PLUGN_VERSION ?= 0.2.1
PLUGN_ARCHITECTURE = amd64
PLUGN_PACKAGE_NAME = plugn_$(PLUGN_VERSION)_$(PLUGN_ARCHITECTURE).deb
PLUGN_URL = https://github.com/dokku/plugn/releases/download/v$(PLUGN_VERSION)/plugn_$(PLUGN_VERSION)_linux_x86_64.tgz
SSHCOMMAND_DESCRIPTION = 'Turn SSH into a thin client specifically for your app'
define SSHCOMMAND_DESCRIPTION
Turn SSH into a thin client specifically for your app
Simplifies running a single command over SSH, and
manages authorized keys (ACL) and users in order to do so.
endef
SSHCOMMAND_REPO_NAME ?= dokku/sshcommand
SSHCOMMAND_VERSION ?= 0.1.0
SSHCOMMAND_VERSION ?= 0.4.0
SSHCOMMAND_ARCHITECTURE = amd64
SSHCOMMAND_PACKAGE_NAME = sshcommand_$(SSHCOMMAND_VERSION)_$(SSHCOMMAND_ARCHITECTURE).deb
SSHCOMMAND_URL ?= https://raw.githubusercontent.com/dokku/sshcommand/v$(SSHCOMMAND_VERSION)/sshcommand
GOROOT = /usr/lib/go
GOBIN = /usr/bin/go
GOPATH = /home/vagrant/gocode
define SIGIL_DESCRIPTION
Standalone string interpolator and template processor
Sigil is a command line tool for template processing
and POSIX-compliant variable expansion. It was created
for configuration templating, but can be used for any
text processing.
endef
SIGIL_REPO_NAME ?= gliderlabs/sigil
SIGIL_VERSION ?= 0.4.0
SIGIL_ARCHITECTURE = amd64
SIGIL_PACKAGE_NAME = gliderlabs_sigil_$(SIGIL_VERSION)_$(SIGIL_ARCHITECTURE).deb
SIGIL_URL = https://github.com/gliderlabs/sigil/releases/download/v$(SIGIL_VERSION)/sigil_$(SIGIL_VERSION)_Linux_x86_64.tgz
.PHONY: install-from-deb deb-all deb-herokuish deb-dokku deb-plugn deb-setup deb-sshcommand
ifndef IS_RELEASE
IS_RELEASE = true
endif
export PLUGN_DESCRIPTION
export SIGIL_DESCRIPTION
export SSHCOMMAND_DESCRIPTION
.PHONY: install-from-deb deb-all deb-herokuish deb-dokku deb-plugn deb-setup deb-sshcommand deb-sigil
install-from-deb:
echo "--> Initial apt-get update"
@echo "--> Initial apt-get update"
sudo apt-get update -qq > /dev/null
sudo apt-get install -qq -y apt-transport-https
echo "--> Installing docker"
@echo "--> Installing docker"
wget -nv -O - https://get.docker.com/ | sh
echo "--> Installing dokku"
@echo "--> Installing dokku"
wget -nv -O - https://packagecloud.io/gpg.key | apt-key add -
echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ trusty main" | sudo tee /etc/apt/sources.list.d/dokku.list
@echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ trusty main" | sudo tee /etc/apt/sources.list.d/dokku.list
sudo apt-get update -qq > /dev/null
sudo apt-get install dokku
sudo DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get install -yy dokku
deb-all: deb-herokuish deb-dokku deb-plugn deb-sshcommand
deb-all: deb-setup deb-herokuish deb-dokku deb-plugn deb-sshcommand deb-sigil
mv /tmp/*.deb .
echo "Done"
@echo "Done"
deb-setup:
echo "-> Updating deb repository and installing build requirements"
sudo apt-get update -qq > /dev/null
sudo apt-get install -qq -y gcc git ruby-dev ruby1.9.1 > /dev/null 2>&1
command -v fpm > /dev/null || sudo gem install fpm --no-ri --no-rdoc
ssh -o StrictHostKeyChecking=no git@github.com || true
@echo "-> Updating deb repository and installing build requirements"
@sudo apt-get update -qq > /dev/null
@sudo DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get install -qq -y gcc git build-essential wget ruby-dev ruby1.9.1 lintian > /dev/null 2>&1
@command -v fpm > /dev/null || sudo gem install fpm --no-ri --no-rdoc
@ssh -o StrictHostKeyChecking=no git@github.com || true
deb-herokuish: deb-setup
deb-herokuish:
rm -rf /tmp/tmp /tmp/build $(HEROKUISH_PACKAGE_NAME)
mkdir -p /tmp/tmp /tmp/build
echo "-> Creating deb files"
echo "#!/usr/bin/env bash" >> /tmp/tmp/post-install
echo "sleep 5" >> /tmp/tmp/post-install
echo "count=\`sudo docker images | grep gliderlabs/herokuish | wc -l\`" >> /tmp/tmp/post-install
echo 'if [ "$$count" -ne 0 ]; then' >> /tmp/tmp/post-install
echo " echo 'Removing old herokuish image'" >> /tmp/tmp/post-install
echo " sudo docker rmi gliderlabs/herokuish" >> /tmp/tmp/post-install
echo "fi" >> /tmp/tmp/post-install
echo "echo 'Importing herokuish into docker (around 5 minutes)'" >> /tmp/tmp/post-install
echo "sudo docker build -t gliderlabs/herokuish /var/lib/herokuish 1> /dev/null" >> /tmp/tmp/post-install
@echo "-> Creating deb files"
@echo "#!/usr/bin/env bash" >> /tmp/tmp/post-install
@echo "sleep 5" >> /tmp/tmp/post-install
@echo "count=\`sudo docker images | grep gliderlabs/herokuish | wc -l\`" >> /tmp/tmp/post-install
@echo 'if [ "$$count" -ne 0 ]; then' >> /tmp/tmp/post-install
@echo " echo 'Removing old herokuish image'" >> /tmp/tmp/post-install
@echo " sudo docker rmi gliderlabs/herokuish" >> /tmp/tmp/post-install
@echo "fi" >> /tmp/tmp/post-install
@echo "echo 'Importing herokuish into docker (around 5 minutes)'" >> /tmp/tmp/post-install
@echo "sudo docker build -t gliderlabs/herokuish /var/lib/herokuish 1> /dev/null" >> /tmp/tmp/post-install
echo "-> Cloning repository"
@echo "-> Cloning repository"
git clone -q "https://github.com/$(HEROKUISH_REPO_NAME).git" /tmp/tmp/herokuish > /dev/null
rm -rf /tmp/tmp/herokuish/.git /tmp/tmp/herokuish/.gitignore
echo "-> Copying files into place"
@echo "-> Copying files into place"
mkdir -p "/tmp/build/var/lib"
cp -rf /tmp/tmp/herokuish /tmp/build/var/lib/herokuish
echo "-> Creating $(HEROKUISH_PACKAGE_NAME)"
sudo fpm -t deb -s dir -C /tmp/build -n herokuish -v $(HEROKUISH_VERSION) -a $(HEROKUISH_ARCHITECTURE) -p $(HEROKUISH_PACKAGE_NAME) --deb-pre-depends 'docker-engine-cs | docker-engine | lxc-docker (>= 1.6.1) | docker.io (>= 1.6.1) | tutum-agent' --deb-pre-depends sudo --after-install /tmp/tmp/post-install --url "https://github.com/$(HEROKUISH_REPO_NAME)" --description $(HEROKUISH_DESCRIPTION) --license 'MIT License' .
@echo "-> Creating $(HEROKUISH_PACKAGE_NAME)"
sudo fpm -t deb -s dir -C /tmp/build -n herokuish -v $(HEROKUISH_VERSION) -a $(HEROKUISH_ARCHITECTURE) -p $(HEROKUISH_PACKAGE_NAME) --deb-pre-depends 'docker-engine-cs (>= 1.9.1) | docker-engine (>= 1.9.1)' --deb-pre-depends sudo --after-install /tmp/tmp/post-install --url "https://github.com/$(HEROKUISH_REPO_NAME)" --description $(HEROKUISH_DESCRIPTION) --license 'MIT License' .
mv *.deb /tmp
deb-dokku: deb-setup
deb-dokku:
rm -rf /tmp/tmp /tmp/build dokku_*_$(DOKKU_ARCHITECTURE).deb
mkdir -p /tmp/tmp /tmp/build
cp -r debian /tmp/build/DEBIAN
mkdir -p /tmp/build/usr/local/bin
mkdir -p /tmp/build/var/lib/dokku/core-plugins/available
mkdir -p /tmp/build/usr/share/man/man1
mkdir -p /tmp/build/usr/share/dokku/contrib
mkdir -p /tmp/build/usr/bin
mkdir -p /tmp/build/usr/share/doc/dokku
mkdir -p /tmp/build/usr/share/dokku/contrib
mkdir -p /tmp/build/usr/share/lintian/overrides
mkdir -p /tmp/build/usr/share/man/man1
mkdir -p /tmp/build/var/lib/dokku/core-plugins/available
cp dokku /tmp/build/usr/local/bin
cp dokku /tmp/build/usr/bin
cp LICENSE /tmp/build/usr/share/doc/dokku/copyright
find . -name ".DS_Store" -depth -exec rm {} \;
cp -r plugins/* /tmp/build/var/lib/dokku/core-plugins/available
find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do touch /tmp/build/var/lib/dokku/core-plugins/available/$$plugin/.core; done
$(MAKE) help2man
@@ -100,46 +130,85 @@ deb-dokku: deb-setup
cp contrib/dokku-installer.py /tmp/build/usr/share/dokku/contrib
git describe --tags > /tmp/build/var/lib/dokku/VERSION
cat /tmp/build/var/lib/dokku/VERSION | cut -d '-' -f 1 | cut -d 'v' -f 2 > /tmp/build/var/lib/dokku/STABLE_VERSION
ifneq (,$(findstring false,$(IS_RELEASE)))
sed -i.bak -e "s/^/`date +%s`:/" /tmp/build/var/lib/dokku/STABLE_VERSION && rm /tmp/build/var/lib/dokku/STABLE_VERSION.bak
endif
rm /tmp/build/DEBIAN/lintian-overrides
mv debian/lintian-overrides /tmp/build/usr/share/lintian/overrides/dokku
git rev-parse HEAD > /tmp/build/var/lib/dokku/GIT_REV
sed -i "s/^Version: .*/Version: `cat /tmp/build/var/lib/dokku/STABLE_VERSION`/g" /tmp/build/DEBIAN/control
dpkg-deb --build /tmp/build "/vagrant/dokku_`cat /tmp/build/var/lib/dokku/STABLE_VERSION`_$(DOKKU_ARCHITECTURE).deb"
mv *.deb /tmp
dpkg-deb --build /tmp/build "/tmp/dokku_`cat /tmp/build/var/lib/dokku/STABLE_VERSION`_$(DOKKU_ARCHITECTURE).deb"
lintian "/tmp/dokku_`cat /tmp/build/var/lib/dokku/STABLE_VERSION`_$(DOKKU_ARCHITECTURE).deb"
deb-plugn: deb-setup
deb-plugn:
rm -rf /tmp/tmp /tmp/build $(PLUGN_PACKAGE_NAME)
mkdir -p /tmp/tmp /tmp/build
mkdir -p /tmp/tmp /tmp/build /tmp/build/usr/bin
echo "-> Cloning repository"
git clone -q "https://github.com/$(PLUGN_REPO_NAME).git" /tmp/tmp/plugn > /dev/null
rm -rf /tmp/tmp/plugn/.git /tmp/tmp/plugn/.gitignore
@echo "-> Downloading package"
wget -q -O /tmp/tmp/plugn-$(PLUGN_VERSION).tgz $(PLUGN_URL)
cd /tmp/tmp/ && tar zxf /tmp/tmp/plugn-$(PLUGN_VERSION).tgz
echo "-> Copying files into place"
mkdir -p /tmp/build/usr/local/bin $(GOPATH)
sudo apt-get clean
sudo apt-get update -qq > /dev/null
sudo apt-get install -qq -y git golang mercurial > /dev/null 2>&1
export PATH=$(PATH):$(GOROOT)/bin:$(GOPATH)/bin && export GOROOT=$(GOROOT) && export GOPATH=$(GOPATH):/tmp/tmp/plugn && go get github.com/dokku/plugn
export PATH=$(PATH):$(GOROOT)/bin:$(GOPATH)/bin && export GOROOT=$(GOROOT) && export GOPATH=$(GOPATH):/tmp/tmp/plugn && cd /home/vagrant/gocode/src/github.com/dokku/plugn && make deps
export PATH=$(PATH):$(GOROOT)/bin:$(GOPATH)/bin && export GOROOT=$(GOROOT) && export GOPATH=$(GOPATH):/tmp/tmp/plugn && cd /home/vagrant/gocode/src/github.com/dokku/plugn && rm plugn && go build -o plugn
mv /home/vagrant/gocode/src/github.com/dokku/plugn/plugn /tmp/build/usr/local/bin/plugn
@echo "-> Copying files into place"
cp /tmp/tmp/plugn /tmp/build/usr/bin/plugn && chmod +x /tmp/build/usr/bin/plugn
echo "-> Creating $(PLUGN_PACKAGE_NAME)"
sudo fpm -t deb -s dir -C /tmp/build -n plugn -v $(PLUGN_VERSION) -a $(PLUGN_ARCHITECTURE) -p $(PLUGN_PACKAGE_NAME) --url "https://github.com/$(PLUGN_REPO_NAME)" --description $(PLUGN_DESCRIPTION) --license 'MIT License' .
@echo "-> Creating $(PLUGN_PACKAGE_NAME)"
sudo fpm -t deb -s dir -C /tmp/build -n plugn \
--version $(PLUGN_VERSION) \
--architecture $(PLUGN_ARCHITECTURE) \
--package $(PLUGN_PACKAGE_NAME) \
--url "https://github.com/$(PLUGN_REPO_NAME)" \
--maintainer "Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>" \
--category utils \
--description "$$PLUGN_DESCRIPTION" \
--license 'MIT License' \
.
mv *.deb /tmp
deb-sshcommand: deb-setup
deb-sshcommand:
rm -rf /tmp/tmp /tmp/build $(SSHCOMMAND_PACKAGE_NAME)
mkdir -p /tmp/tmp /tmp/build
mkdir -p /tmp/tmp /tmp/build /tmp/build/usr/local/bin
echo "-> Cloning repository"
git clone -q "https://github.com/$(SSHCOMMAND_REPO_NAME).git" /tmp/tmp/sshcommand > /dev/null
rm -rf /tmp/tmp/sshcommand/.git /tmp/tmp/sshcommand/.gitignore
@echo "-> Downloading package"
wget -q -O /tmp/tmp/sshcommand-$(SSHCOMMAND_VERSION) $(SSHCOMMAND_URL)
echo "-> Copying files into place"
@echo "-> Copying files into place"
mkdir -p "/tmp/build/usr/local/bin"
cp /tmp/tmp/sshcommand/sshcommand /tmp/build/usr/local/bin/sshcommand
cp /tmp/tmp/sshcommand-$(SSHCOMMAND_VERSION) /tmp/build/usr/local/bin/sshcommand
chmod +x /tmp/build/usr/local/bin/sshcommand
echo "-> Creating $(SSHCOMMAND_PACKAGE_NAME)"
sudo fpm -t deb -s dir -C /tmp/build -n sshcommand -v $(SSHCOMMAND_VERSION) -a $(SSHCOMMAND_ARCHITECTURE) -p $(SSHCOMMAND_PACKAGE_NAME) --url "https://github.com/$(SSHCOMMAND_REPO_NAME)" --description $(SSHCOMMAND_DESCRIPTION) --license 'MIT License' .
@echo "-> Creating $(SSHCOMMAND_PACKAGE_NAME)"
sudo fpm -t deb -s dir -C /tmp/build -n sshcommand \
--version $(SSHCOMMAND_VERSION) \
--architecture $(SSHCOMMAND_ARCHITECTURE) \
--package $(SSHCOMMAND_PACKAGE_NAME) \
--url "https://github.com/$(SSHCOMMAND_REPO_NAME)" \
--maintainer "Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>" \
--category admin \
--description "$$SSHCOMMAND_DESCRIPTION" \
--license 'MIT License' \
.
mv *.deb /tmp
deb-sigil:
rm -rf /tmp/tmp /tmp/build $(SIGIL_PACKAGE_NAME)
mkdir -p /tmp/tmp /tmp/build /tmp/build/usr/bin
@echo "-> Downloading package"
wget -q -O /tmp/tmp/sigil-$(SIGIL_VERSION).tgz $(SIGIL_URL)
cd /tmp/tmp/ && tar zxf /tmp/tmp/sigil-$(SIGIL_VERSION).tgz
@echo "-> Copying files into place"
cp /tmp/tmp/sigil /tmp/build/usr/bin/sigil && chmod +x /tmp/build/usr/bin/sigil
@echo "-> Creating $(SIGIL_PACKAGE_NAME)"
sudo fpm -t deb -s dir -C /tmp/build -n gliderlabs-sigil \
--version $(SIGIL_VERSION) \
--architecture $(SIGIL_ARCHITECTURE) \
--package $(SIGIL_PACKAGE_NAME) \
--url "https://github.com/$(SIGIL_REPO_NAME)" \
--maintainer "Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>" \
--category utils \
--description "$$SIGIL_DESCRIPTION" \
--license 'MIT License' \
.
mv *.deb /tmp

8
debian/config vendored
View File

@@ -1,6 +1,10 @@
#!/bin/sh -e
#!/bin/bash
set -eo pipefail; [[ $TRACE ]] && set -x
. /usr/share/debconf/confmodule
if [[ -e /usr/share/debconf/confmodule ]]; then
# shellcheck disable=SC1091
. /usr/share/debconf/confmodule
fi
readonly ACTION="${1:-configure}"
readonly VERSION="${2:-dev}"

9
debian/control vendored
View File

@@ -1,11 +1,12 @@
Package: dokku
Version: 0.4.10
Version: 0.6.2
Section: web
Priority: optional
Architecture: amd64
Depends: locales, git, make, curl, gcc, man-db, sshcommand, docker-engine-cs | docker-engine | lxc-docker (>= 1.6.1) | docker.io (>= 1.6.1) | tutum-agent, software-properties-common, python-software-properties
Depends: locales, git, make, curl, gcc, man-db, sshcommand, gliderlabs-sigil, docker-engine-cs (>= 1.9.1) | docker-engine (>= 1.9.1), software-properties-common, python-software-properties
Recommends: herokuish
Pre-Depends: nginx (>= 1.4.6), dnsutils, apparmor, cgroupfs-mount | cgroup-lite, plugn, sudo, python2.7, debconf
Pre-Depends: nginx, dnsutils, apparmor, cgroupfs-mount | cgroup-lite, plugn, sudo, python2.7, debconf
Maintainer: Jose Diaz-Gonzalez <dokku@josediazgonzalez.com>
Description: Docker-powered PaaS that helps build and manage the lifecycle of applications
Dokku is an extensible, open source Platform as a Service
that runs on a single server of your choice.

3
debian/lintian-overrides vendored Normal file
View File

@@ -0,0 +1,3 @@
dokku: command-with-path-in-maintainer-script postinst:16 /usr/bin/sshcommand
dokku: maintainer-script-calls-systemctl postinst:87
dokku: changelog-file-missing-in-native-package

33
debian/postinst vendored
View File

@@ -1,11 +1,25 @@
#!/bin/bash
set -eo pipefail; [[ $TRACE ]] && set -x
. /usr/share/debconf/confmodule
if [[ -e /usr/share/debconf/confmodule ]]; then
# shellcheck disable=SC1091
. /usr/share/debconf/confmodule
fi
readonly DOKKU_ROOT="${DOKKU_ROOT:-/home/dokku}"
readonly DOKKU_LIB_ROOT="${DOKKU_LIB_PATH:-/var/lib/dokku}"
call-sshcommand() {
if [[ -x /usr/local/bin/sshcommand ]]; then
/usr/local/bin/sshcommand "$@"
elif [[ -x /usr/bin/sshcommand ]]; then
/usr/bin/sshcommand "$@"
else
echo "Unable to find sshcommand binary" 1>&2
exit 1
fi
}
case "$1" in
abort-upgrade|abort-remove|abort-deconfigure)
;;
@@ -14,10 +28,15 @@ case "$1" in
mandb
[ ! -x /usr/bin/docker.io ] || ln -sf /usr/bin/docker.io /usr/local/bin/docker
modprobe aufs || echo "WARNING: Restart server to finish installing dokku!"
sshcommand create dokku /usr/local/bin/dokku
call-sshcommand create dokku /usr/bin/dokku
egrep -i "^docker" /etc/group || groupadd docker
usermod -aG docker dokku
echo "Setting up storage directories"
mkdir -p ${DOKKU_LIB_ROOT}/data ${DOKKU_LIB_ROOT}/data/storage
chown dokku:dokku -R ${DOKKU_LIB_ROOT}/data
echo "Setting up plugin directories"
# should be replaced by `plugn init`
mkdir -p ${DOKKU_LIB_ROOT}/core-plugins/available ${DOKKU_LIB_ROOT}/plugins/available
@@ -43,8 +62,16 @@ case "$1" in
PLUGIN_PATH=${DOKKU_LIB_ROOT}/plugins plugn enable $plugin
fi
done
find -L ${DOKKU_LIB_ROOT} -type l -delete
chown dokku:dokku -R ${DOKKU_LIB_ROOT}/plugins ${DOKKU_LIB_ROOT}/core-plugins
echo "Ensure proper sshcommand path"
echo '/usr/bin/dokku' > "${DOKKU_ROOT}/.sshcommand"
if [[ -f .ssh/authorized_keys ]]; then
sed -i.bak 's#/usr/local/bin/dokku#/usr/bin/dokku#' "${DOKKU_ROOT}/.ssh/authorized_keys"
rm "${DOKKU_ROOT}/.ssh/authorized_keys"
fi
echo "Install all core plugins"
dokku plugin:install --core
@@ -87,7 +114,7 @@ case "$1" in
if [ -z "${DEBCONF_RECONFIGURE}" ]; then
db_get "dokku/key_file"
if [ -f "$RET" ]; then
sshcommand acl-add dokku default < "$RET"
call-sshcommand acl-add dokku default < "$RET" || true
fi
fi
;;

12
debian/postrm vendored
View File

@@ -1,6 +1,11 @@
#!/bin/bash
set -eo pipefail; [[ $TRACE ]] && set -x
if [[ -e /usr/share/debconf/confmodule ]]; then
# shellcheck disable=SC1091
. /usr/share/debconf/confmodule
fi
readonly DOKKU_ROOT="${DOKKU_ROOT:-/home/dokku}"
readonly DOKKU_LIB_ROOT="${DOKKU_LIB_PATH:-/var/lib/dokku}"
@@ -15,7 +20,7 @@ main() {
rm -f /etc/systemd/system/dokku-redeploy.service
rm -f /etc/update-motd.d/99-dokku
service nginx reload
(nginx -t && service nginx reload) || true
if [[ "$1" == "purge" ]]; then
rm -f ${DOKKU_ROOT}/.dokkurc ${DOKKU_ROOT}/dokkurc ${DOKKU_ROOT}/tls
@@ -35,10 +40,7 @@ main() {
find ${DOKKU_ROOT} -type d -empty -delete
fi
if [[ -e /usr/share/debconf/confmodule ]]; then
. /usr/share/debconf/confmodule
db_purge
fi
db_purge
fi
}

8
debian/preinst vendored
View File

@@ -1,7 +1,10 @@
#!/bin/bash
set -eo pipefail; [[ $TRACE ]] && set -x
. /usr/share/debconf/confmodule
if [[ -e /usr/share/debconf/confmodule ]]; then
# shellcheck disable=SC1091
. /usr/share/debconf/confmodule
fi
case "$1" in
install)
@@ -27,7 +30,8 @@ case "$1" in
exit 0
fi
if [ -z "${DEBCONF_RECONFIGURE}" ]; then
db_get "dokku/skip_key_file"
if [ -z "${DEBCONF_RECONFIGURE}" ] && [ "$RET" != "true" ]; then
db_get "dokku/key_file"
if [ ! -f "$RET" ]; then
echo "Error: keyfile '$RET' not found."

5
debian/templates vendored
View File

@@ -13,6 +13,11 @@ Description: Hostname or IP for server:
Type: string
Default: dokku.me
Template: dokku/skip_key_file
Description: Skip key file requirement?
Type: boolean
Default: false
Template: dokku/key_file
Description: Keyfile for initial user:
Type: string

View File

@@ -3,7 +3,9 @@
You can always install dokku straight from the latest - potentially unstable - master release via the following bash command:
```shell
wget -qO- https://raw.githubusercontent.com/dokku/dokku/master/bootstrap.sh | sudo DOKKU_BRANCH=master bash
# using a branch results in installing from source
wget https://raw.githubusercontent.com/dokku/dokku/master/bootstrap.sh
sudo DOKKU_BRANCH=master bash bootstrap.sh
```
## Development
@@ -46,15 +48,11 @@ sudo BUILD_STACK=true STACK_URL=https://github.com/gliderlabs/herokuish.git make
Once dokku is installed, if you are not using the web-installer, you'll want to configure a the virtualhost setup as well as the push user. If you do not, your installation will be considered incomplete and you will not be able to deploy applications.
*You should also stop and disable the `dokku-installer` service to remove public access to adding SSH keys.*
Set up a domain and a wildcard domain pointing to that host. Make sure `/home/dokku/VHOST` is set to this domain. By default it's set to whatever hostname the host has. This file is only created if the hostname can be resolved by dig (`dig +short $(hostname -f)`). Otherwise you have to create the file manually and set it to your preferred domain. If this file still is not present when you push your app, dokku will publish the app with a port number (i.e. `http://example.com:49154` - note the missing subdomain).
You'll have to add a public key associated with a username by doing something like this from your local machine:
$ cat ~/.ssh/id_rsa.pub | ssh dokku.me "sudo sshcommand acl-add dokku $USER"
If you are using the vagrant installation, you can use the following command to add your public key to dokku:
$ cat ~/.ssh/id_rsa.pub | make vagrant-acl-add
Follow the [user management documentation](/dokku/deployment/user-management) in order to add users to dokku.
That's it!

View File

@@ -0,0 +1,25 @@
# 0.5.0 Migration Guide
## nginx-vhosts
- The nginx-vhosts template language is now [sigil](https://github.com/gliderlabs/sigil)
- No need to escape literal `$` characters (or other "bash-isms")
- Template variables are represented as {{ .VARIABLE_NAME }}
- A detailed list of template variables can be found [here](/dokku/nginx#available-template-variables)
- A custom nginx-vhosts template must be named `nginx.conf.sigil`
- The default path for this custom template is the root of your repo (i.e. `/app` in the container or `WORKDIR` if defined in a dockerfile app)
- Dokku no longer looks for this file in `/home/dokku/myapp` on the dokku server
- Check out an example template [here](/dokku/nginx/)
- Support for server-wide SSL certs have been dropped in favor of using the `certs` plugin
- `dokku certs:add myapp < certs.tar`
- All domains for an SSL-enabled app will be redirected to https by default
- This can be overridden with a custom template
- Replaced "magic" `NO_VHOST` variable with `domains:enable/disable`
- Simplified zero downtime control
- `checks:enable/disable`
## Dockerfile apps with exposed ports
- Dockerfiles with `EXPOSE` clauses will get [all **tcp** ports proxied by default](/dokku/deployment/dockerfiles/#exposed-ports)
- Note that nginx will proxy the same port numbers to listen publicly
- UDP ports can be exposed by disabling the [nginx proxy](/dokku/proxy/) with `dokku proxy:disable myapp`

View File

@@ -0,0 +1,26 @@
# 0.6.0 Migration Guide
## zero-downtime deployment
- You can now **actually** disable zero-downtime deployments per-app and per-process-type
- Some config variables have been moved around
- `DOKKU_CHECKS_ENABLED` has been migrated to `DOKKU_CHECKS_SKIPPED`
- `DOKKU_CHECKS_DISABLED` is now a thing
- The values for the above can be a comma-separated list of process-types or the literal string `_all_`
- See the [updated `checks`](/dokku/checks-examples/) docs for more info
## proxy port mapping
- You can now configure host -> container proxy port mappings
- The UI is handled by the [proxy](/dokku/proxy/) interface plugin by setting the `DOKKU_PROXY_PORT_MAP` config variable in the format of `scheme:host-port:container-port`. The default `nginx-vhosts` proxy plugin supports both the `http` and `https` schemes.
## calling the dokku binary
- Plugins should *not* call the dokku binary directly. Clients using the `--app` argument are potentially broken, amongst others, when doing so. Instead, please source the `functions` file for a given plugin when attempting to call dokku internal functions. As a result, the following dokku commands are no longer publicly exposed:
- dokku build
- dokku receive
- dokku release
- dokku tar:build
- dokku tar:build-locked
- dokku git:build
- dokku git:build-locked

View File

@@ -5,6 +5,7 @@
Once Dokku has been configured with at least one user, applications can be deployed via a `git push` command. To quickly see Dokku deployment in action, you can use the Heroku Ruby on Rails example app.
```shell
# from your local machine
git clone git@github.com:heroku/ruby-rails-sample.git
```
@@ -13,6 +14,7 @@ git clone git@github.com:heroku/ruby-rails-sample.git
Create the application on the Dokku host. You will need to ssh onto the host to run this command.
```shell
# on your dokku host
dokku apps:create ruby-rails-sample
```
@@ -21,6 +23,7 @@ dokku apps:create ruby-rails-sample
When you create a new app, Dokku by default *does not* provide any datastores such as MySQL or PostgreSQL. You will need to install plugins to handle that, but fortunately [Dokku has official plugins](/dokku/plugins/#official-plugins-beta) for common datastores. Our sample app requires a PostgreSQL service:
```shell
# on your dokku host
# install the postgres plugin
# plugin installation requires root, hence the user change
sudo dokku plugin:install https://github.com/dokku/dokku-postgres.git
@@ -36,6 +39,7 @@ dokku postgres:create rails-database
Once the service creation is complete, set the `POSTGRES_URL` environment variable by linking the service.
```shell
# on your dokku host
# each official datastore offers a `link` method to link a service to any application
dokku postgres:link rails-database ruby-rails-sample
```
@@ -47,6 +51,7 @@ dokku postgres:link rails-database ruby-rails-sample
Now you can deploy the `ruby-rails-sample` app to your Dokku server. All you have to do is add a remote to name the app. Applications are created on-the-fly on the Dokku server.
```shell
# from your local machine
git remote add dokku dokku@dokku.me:ruby-rails-sample
git push dokku master
```
@@ -89,6 +94,7 @@ Dokku supports deploying applications via [Heroku buildpacks](https://devcenter.
You can also remove an application from your Dokku installation. This will unlink all linked services and destroy any config related to the application. Note that linked services will retain their data for later use (or removal).
```shell
# on your dokku host
# replace APP with the name of your application
dokku apps:destroy APP
```
@@ -96,6 +102,7 @@ dokku apps:destroy APP
This will prompt you to verify the application's name before destroying it. You may also use the `--force` flag to circumvent this verification process:
```shell
# on your dokku host
# replace APP with the name of your application
dokku --force apps:destroy APP
```
@@ -107,21 +114,12 @@ dokku --force apps:destroy APP
You can rename a deployed app using the `apps:rename` CLI tool:
```shell
# on your dokku host
dokku apps:rename OLD_NAME NEW_NAME
```
This will copy all of your app's contents into a new app directory with the name of your choice, delete your old app, then rebuild the new version of the app and deploy it. All of your config variables, including database urls, will be preserved.
### Adding deploy users
While it is possible to use password-based authorization to push to Dokku, it is preferable to use key-based authentication for security. You can add your public key to the dokku user's `authorized_keys` file with the following command:
```shell
# replace dokku.me with your domain name or the host's IP
# replace root with your server's root user
cat ~/.ssh/id_rsa.pub | ssh root@dokku.com "sudo sshcommand acl-add dokku [description]"
```
### Deploying non-master branch
Dokku only supports deploying from its master branch, so if you'd like to deploy a different local branch use: ```git push dokku <local branch>:master```
@@ -133,6 +131,7 @@ You can also support pushing multiple branches using the [receive-branch](/dokku
If you only want to rebuild and tag a container, you can skip the deployment phase by setting `$DOKKU_SKIP_DEPLOY` to `true` by running:
``` shell
# on your dokku host
dokku config:set ruby-rails-sample DOKKU_SKIP_DEPLOY=true
```
@@ -141,6 +140,7 @@ dokku config:set ruby-rails-sample DOKKU_SKIP_DEPLOY=true
Dokku uses git locally (i.e. not a docker image) to build its own copy of your app repo, including submodules. This is done as the `dokku` user. Therefore, in order to deploy private git submodules, you'll need to drop your deploy key in `/home/dokku/.ssh/` and potentially add github.com (or your VCS host key) into `/home/dokku/.ssh/known_hosts`. The following test should help confirm you've done it correctly.
```shell
# on your dokku host
su - dokku
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
ssh -T git@github.com
@@ -182,11 +182,13 @@ This is in particular useful, then you want to deploy to root domain, as
## Dokku/Docker Container Management Compatibility
Dokku is, at its core, a docker container manager. Thus, it does not necessarily play well with other out-of-band processes interacting with the docker daemon. One thing to note as in [issue #1220](https://github.com/dokku/dokku/issues/1220), dokku executes a cleanup function prior to every deployment. This function removes all exited containers and all 'unattached' images.
Dokku is, at its core, a docker container manager. Thus, it does not necessarily play well with other out-of-band processes interacting with the docker daemon. One thing to note as in [issue #1220](https://github.com/dokku/dokku/issues/1220), dokku executes a cleanup function prior to every deployment.
### Specifying a custom buildpack
As of 0.5.x, this function removes all containers with the label `dokku` where the status is either `dead` or `exited`, as well as all `dangling` images. Previous versions would remove `dead` or `exited` containers, regardless of their label.
See the [buildpack documentation](/dokku/deployment/buildpacks/).
## Adding deploy users
See the [user management documentation](/dokku/deployment/user-management).
## Default vhost
@@ -196,10 +198,14 @@ See the [nginx documentation](/dokku/nginx/#default-site).
See the [dockerfile documentation](/dokku/deployment/dockerfiles/).
## Zero downtime deploy
## Specifying a custom buildpack
See the [zero-downtime deploy documentation](/dokku/checks-examples/).
See the [buildpack documentation](/dokku/deployment/buildpacks/).
## Image tagging
See the [image tagging documentation](/dokku/deployment/images).
## Zero downtime deploy
See the [zero-downtime deploy documentation](/dokku/checks-examples/).

View File

@@ -2,10 +2,10 @@
<browserconfig>
<msapplication>
<tile>
<square70x70logo src="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/mstile-70x70.png"/>
<square150x150logo src="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/mstile-150x150.png"/>
<square310x310logo src="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/mstile-310x310.png"/>
<wide310x150logo src="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/mstile-310x150.png"/>
<square70x70logo src="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/mstile-70x70.png"/>
<square150x150logo src="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/mstile-150x150.png"/>
<square310x310logo src="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/mstile-310x310.png"/>
<wide310x150logo src="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/mstile-310x150.png"/>
<TileColor>#da532c</TileColor>
</tile>
</msapplication>

View File

@@ -2,37 +2,37 @@
"name": "Dokku",
"icons": [
{
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.4.10\/docs\/assets\/favicons\/android-chrome-36x36.png",
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.6.2\/docs\/assets\/favicons\/android-chrome-36x36.png",
"sizes": "36x36",
"type": "image\/png",
"density": "0.75"
},
{
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.4.10\/docs\/assets\/favicons\/android-chrome-48x48.png",
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.6.2\/docs\/assets\/favicons\/android-chrome-48x48.png",
"sizes": "48x48",
"type": "image\/png",
"density": "1.0"
},
{
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.4.10\/docs\/assets\/favicons\/android-chrome-72x72.png",
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.6.2\/docs\/assets\/favicons\/android-chrome-72x72.png",
"sizes": "72x72",
"type": "image\/png",
"density": "1.5"
},
{
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.4.10\/docs\/assets\/favicons\/android-chrome-96x96.png",
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.6.2\/docs\/assets\/favicons\/android-chrome-96x96.png",
"sizes": "96x96",
"type": "image\/png",
"density": "2.0"
},
{
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.4.10\/docs\/assets\/favicons\/android-chrome-144x144.png",
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.6.2\/docs\/assets\/favicons\/android-chrome-144x144.png",
"sizes": "144x144",
"type": "image\/png",
"density": "3.0"
},
{
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.4.10\/docs\/assets\/favicons\/android-chrome-192x192.png",
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.6.2\/docs\/assets\/favicons\/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image\/png",
"density": "4.0"

BIN
docs/assets/slack-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

View File

@@ -1,11 +1,11 @@
body {
font-family: 'Open Sans', sans-serif;
font-weight: 400;
font-size: 12px;
padding-bottom: 40px;
color: #5a5a5a;
-webkit-font-smoothing: antialiased;
}
h1 {
color: #5a5a5a;
font-weight: 400;
@@ -25,9 +25,7 @@ h1 {
padding: 0 0 0 1em;
}
.header a {
background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/dokku.png);
color: #fff;
text-indent: 40px;
background-position: center left;
display: block;
width: 100%;
@@ -37,23 +35,25 @@ h1 {
background-size: contain;
background-repeat: no-repeat;
}
.header .navbar-brand a {
background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/dokku.png);
text-indent: 40px;
}
.blurb {
color: #424242;
background-color: #ededed;
background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/gplaypattern.png);
background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/gplaypattern.png);
padding: 45px 0;
text-align: center;
}
.blurb p {
font-size: 17px;
font-weight: 300;
margin: 18px 0 18px;
margin: 18px 0;
text-align: center;
}
.quickstart-code {
display: block;
font-size: 12px;
line-height: 1.3em;
margin: 45px auto;
max-width: 750px;
@@ -62,7 +62,8 @@ h1 {
.quickstart-code .title {
background-color: #dfdfdf;
background-image: linear-gradient(top, #f7f7f7 0%, #dfdfdf 7%, #ccc 100%);
border-bottom: 1px solid #111;
border-radius: 5px 5px 0 0;
box-shadow: 0 3px 0 rgba(0, 0, 0, 0.5);
color: #444;
display: block;
font-weight: 400;
@@ -70,18 +71,47 @@ h1 {
margin: 0 20px;
padding: 3px 0;
text-align: center;
text-shadow: 0 1px 0 rgba(255,255,255,0.5);
border-radius: 5px 5px 0 0;
box-shadow: 0 3px 0 rgba(0,0,0,0.5);
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}
.quickstart-code .tabs {
background-color: #bcbcbc;
border-top: 1px solid #686868;
color: #444;
display: flex;
display: -webkit-flex;
font-weight: bold;
margin: 0 20px;
padding: 0;
text-align: center;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}
.quickstart-code .tab {
border-right: 1px solid #686868;
cursor: pointer;
flex: 1;
-webkit-flex: 1;
}
.quickstart-code .tab-active {
background-color: #ededed;
border-radius: 0 0 5px 5px;
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}
.quickstart-code .tab:last-of-type {
border-right: none;
}
.quickstart-code .shell {
background-color: #171717;
border-radius: 0 0 5px 5px;
border-top: 1px solid #bcbcbc;
box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
display: none;
font-family: Menlo, Consolas, "Courier New", Courier, "Liberation Mono", monospace;
margin: 0 20px;
padding: 20px;
text-shadow: none;
border-radius: 0 0 5px 5px;
box-shadow: 0 5px 30px rgba(0,0,0,0.3);
}
.quickstart-code .shell-active {
display: block;
}
.quickstart-code .line {
display: block;
@@ -91,19 +121,28 @@ h1 {
.quickstart-code .line span {
display: inline-block;
}
.quickstart-code .line .output {
color: #aaa;
}
.quickstart-code .path {
color: #2a8fbd;
content: '~';
user-select: none;
}
.quickstart-code .prompt {
color: #ff9900;
color: #f90;
user-select: none;
}
.quickstart-code .command {
color: #ffffcc;
color: #ffc;
}
.quickstart-code .line .output {
color: #aaaaaa;
.alternate-instructions {
display: block;
line-height: 1.3em;
margin: 45px auto;
max-width: 750px;
padding: 0;
text-align: center;
}
.marketing .col-lg-4 {
margin-bottom: 20px;
@@ -113,7 +152,6 @@ h1 {
margin-right: 10px;
margin-left: 10px;
}
.featurette-divider {
margin: 20px 0;
}
@@ -125,9 +163,54 @@ h1 {
.featurette-heading .text-muted {
font-weight: 300;
}
.featurette img {
width: 400px;
}
.slack-channel {
background-color: #EEF1F7;
font-size: 16px;
font-weight: 300;
margin-bottom: 2.5em;
padding: 2.5em 0;
text-align: center
}
.slack-channel .inline-container {
display: inline-block;
margin-left: 0.5em
}
.slack-button {
background-image: -webkit-linear-gradient(#FCFCFC, #EAEAEA);
background-image: linear-gradient(#FCFCFC, #EAEAEA);
border: 1px solid #ddd;
padding: 0.25rem 0.5rem;
}
.slack-button img {
height: 1em;
}
.team-members img {
-moz-box-shadow: 4px 4px 8px 0px rgba(0,0,0,0.75);
-webkit-border-radius: 3px;
-webkit-box-shadow: 4px 4px 8px 0px rgba(0,0,0,0.75);
border-radius: 3px;
border: 8px solid white;
box-shadow: 4px 4px 8px 0px rgba(0,0,0,0.75);
display: block;
height: 200px;
margin: 20px auto 20px auto;
}
.team-members .fund-link {
display: block;
font-size: 80%;
}
.team-member {
min-height: 320px;
}
.team-member-image img:last-child { display: none }
.team-member-image:hover img:first-child { display: none; }
.team-member-image:hover img:last-child { display: inline-block; }
.list-group-item {
border: none;
font-size: 13px;
font-weight: normal;
padding: .2rem .5rem;
color: #157577;
@@ -143,13 +226,21 @@ a.list-group-item {
color: #bbb;
cursor: default;
font-weight: normal;
font-size: 11px;
margin-bottom: 1em;
margin-top: 2em;
text-transform: uppercase;
}
.table-of-contents {
font-size: 0.8em;
padding: 1em;
margin: 0 0 0.5em 0.5em;
}
.table-of-contents ul {
margin-bottom: 0;
padding-left: 20px;
}
.anchorjs-link {
color: #24cbce;
color: #24cbce;
}
.markdown-body {
-webkit-font-smoothing: antialiased;
@@ -173,7 +264,7 @@ a.list-group-item {
font-size: 17px;
font-weight: 700;
color: #555;
margin-top: 3em;
margin-top: 2em;
text-transform: uppercase;
}
.markdown-body h3 {
@@ -198,7 +289,7 @@ code {
margin: 0;
font-size: 85%;
background-color: #fff;
background-color: rgba(0,0,0,0.06);
background-color: rgba(0, 0, 0, 0.06);
color: #333;
-webkit-border-radius: 3px;
border-radius: 3px;
@@ -223,9 +314,8 @@ pre {
word-wrap: normal;
border: 1px solid #cccccc;
border-radius: 4px;
font-size: 12px;
box-shadow: 0 0 0 3px #eee;
overflow: auto !important;
overflow: auto;
padding: 10px;
background-color: #fff;
color: #4d4d4c;
@@ -237,22 +327,217 @@ blockquote {
padding: 15px 15px 1px;
margin-bottom: 30px;
}
blockquote.new-as-of {
.new-as-of {
border-left: 4px solid #d1f2a5;
background-color: #effab4;
}
.not-yet-released {
border-left: 4px solid #ef5b58;
background-color: #f9ad76;
}
.fa:before {
-webkit-font-smoothing: antialiased
}
.clearfix {
*zoom: 1
}
.clearfix:before, .clearfix:after {
display: table;
content: ""
}
.clearfix:after {
clear: both
}
a .fa {
display: inline-block;
text-decoration: inherit
}
li .fa {
display: inline-block
}
li .fa-large:before, li .fa-large:before {
width: 1.875em
}
ul.fas {
list-style-type: none;
margin-left: 2em;
text-indent: -0.8em
}
ul.fas li .fa {
width: 0.8em
}
ul.fas li .fa-large:before, ul.fas li .fa-large:before {
vertical-align: baseline
}
.rst-versions {
position: fixed;
bottom: 0;
left: 0;
width: 300px;
color: #fcfcfc;
background: #15518d;
border-top: solid 10px #343131;
font-family: "Lato", "proxima-nova", "Helvetica Neue", Arial, sans-serif;
z-index: 400
}
.rst-versions a {
color: #7c8e98;
text-decoration: none
}
.rst-versions .rst-badge-small {
display: none
}
.rst-versions .rst-current-version {
padding: 12px;
background-color: #2475c3;
display: block;
text-align: right;
cursor: pointer;
color: #d8edf8;
*zoom: 1
}
.rst-versions .rst-current-version:before, .rst-versions .rst-current-version:after {
display: table;
content: ""
}
.rst-versions .rst-current-version:after {
clear: both
}
.rst-versions .rst-current-version .fa {
color: #fcfcfc
}
.rst-versions .rst-current-version .fa-book {
float: left;
line-height: 30px
}
.rst-versions .rst-current-version .icon-book {
float: left
}
.rst-versions .rst-current-version.rst-out-of-date {
background-color: #E74C3C;
color: #fff
}
.rst-versions .rst-current-version.rst-active-old-version {
background-color: #F1C40F;
color: #000
}
.rst-versions.rst-badge {
border: none;
bottom: 20px;
display: block;
left: auto;
max-width: 300px;
right: 20px;
width: auto;
}
.rst-versions.rst-badge .icon-book {
float: none
}
.rst-versions.rst-badge .fa-book {
float: none
}
.rst-versions.rst-badge.shift-up .rst-current-version {
text-align: right
}
.rst-versions.rst-badge.shift-up .rst-current-version .fa-book {
float: left
}
.rst-versions.rst-badge.shift-up .rst-current-version .icon-book {
float: left
}
.rst-versions.rst-badge .rst-current-version {
width: auto;
height: 30px;
line-height: 30px;
padding: 0 6px;
display: block;
text-align: center
}
.rst-other-versions {
display: none;
padding: 12px;
text-align: left;
}
.shift-up .rst-other-versions {
display: block;
}
.rst-other-versions a {
border: 0;
}
.rst-other-versions hr {
display: block;
border: 0;
margin: 20px 0;
padding: 0;
border-top: solid 1px #d6edf9
}
.rst-other-versions dl {
margin: 0;
}
.rst-other-versions dd {
display: inline-block;
margin: 0
}
.rst-other-versions dd a {
display: inline-block;
padding: 6px;
color: #fcfcfc
}
.dev-warning, .outdated-warning {
position: absolute;
top: 0;
width: 100%;
padding: 8px 20px 8px;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
background-image: -webkit-linear-gradient(-45deg, rgba(0, 0, 0, 0.04) 25%, transparent 25%, transparent 50%, rgba(0, 0, 0, 0.04) 50%, rgba(0, 0, 0, 0.04) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(-45deg, rgba(0, 0, 0, 0.04) 25%, transparent 25%, transparent 50%, rgba(0, 0, 0, 0.04) 50%, rgba(0, 0, 0, 0.04) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(-45deg, rgba(0, 0, 0, 0.04) 25%, transparent 25%, transparent 50%, rgba(0, 0, 0, 0.04) 50%, rgba(0, 0, 0, 0.04) 75%, transparent 75%, transparent);
background-image: -ms-linear-gradient(-45deg, rgba(0, 0, 0, 0.04) 25%, transparent 25%, transparent 50%, rgba(0, 0, 0, 0.04) 50%, rgba(0, 0, 0, 0.04) 75%, transparent 75%, transparent);
background-image: linear-gradient(135deg, rgba(0, 0, 0, 0.04) 25%, transparent 25%, transparent 50%, rgba(0, 0, 0, 0.04) 50%, rgba(0, 0, 0, 0.04) 75%, transparent 75%, transparent);
font-family: "Roboto", Corbel, Avenir, "Lucida Grande", "Lucida Sans", sans-serif;
font-size: 14px;
text-align: center;
background-color: #ffe761;
}
@media screen and (max-width: 768px) {
.rst-versions {
width: 85%;
display: none
}
.rst-versions.shift {
display: block
}
img {
width: 100%;
height: auto
}
}
@media (min-width: 768px) {
.quickstart-code {
.col-md-offset-right-2 {
margin-right: 20.666667%;
}
.quickstart-code shell {
font-size: 14px;
}
.quickstart-code {
line-height: 22px;
}
.featurette-heading {
font-size: 50px;
}
}
@media (min-width: 992px) {
.featurette img {
width: 300px;
}
.featurette-heading {
margin-top: 120px;
margin-top: 30px;
}
}
@media (max-width: 992px) {
.featurette img {
width: 200px;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

BIN
docs/assets/team/flink.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

BIN
docs/assets/team/u2mejc.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@@ -0,0 +1,8 @@
{
"max-versions": [
"0.3.26",
"0.4.14",
"0.5.8",
"0.6.2"
]
}

45
docs/backup-recovery.md Normal file
View File

@@ -0,0 +1,45 @@
# Backup and Recovery
> The backup plugin was deprecated in 0.4.x, below are backup recommendations for 0.5.x and later.
## Backup and Migration Tutorial
Because Dokku is git based, rebuilding a deployed app is as easy as pushing from git. You can push to a new server by updating the dokku remote in you local app's repo.
```
$ git remote rm dokku
$ git remote add dokku dokku@[dokku.me:dokku.me]
$ git push dokku [master]
```
## Databases
Some plugins, like the official [dokku-postgres] plugin, have built-in commands that allow non-volatile data be exported and imported.
For [dokku-postgres], use:
```
dokku postgres:export [db_name] > [db_name].dump
dokku postgres:import [db_name] < [db_name].dump
```
## Volumes and Static Assets
Dokku doesn't enforce a [300mb] limit on apps, but it's best practice to keep binary assets outside of git. Since containers are considered volatile in Dokku, external stores like s3 or storage mounts should be used for non-volatile items like user uploads. The dokku storage core plugin can be used to mount local directories / volumes inside the docker container.
```
storage:list <app>, List bind mounts for app's container(s) (host:container)
storage:mount <app> <host-dir:container-dir>, Create a new bind mount
storage:unmount <app> <host-dir:container-dir>, Remove an existing bind mount
```
## Disaster Recovery
The best plan for disaster recovery is to always keep multiple (remote) copies of your local repo, static assets and periodic database dumps. In case of an emergency when your git repo and backups are completely lost, you can recover the last pushed copy from your remote dokku server (assuming you still have the ssh key).
```
mkdir [app-name] ; cd !$
git init && git remote add dokku dokku@[dokku.me:app-name]
git pull dokku/master && git checkout dokku/master
```
[dokku-postgres]: <https://github.com/dokku/dokku-postgres>
[300mb]: <https://devcenter.heroku.com/articles/slug-compiler#slug-size>

View File

@@ -1,60 +1,82 @@
# Zero Downtime Deploys
> New as of 0.3.0
> New as of 0.5.0
Following a deploy, dokku will now wait `10` seconds before routing traffic to the new container. If the container is not running after this time, then the deploy is failed and your old container will continue serving traffic. You can modify this value using the following command:
```
checks <app> Show zero-downtime status
checks:disable <app> [process-type(s)] Disable zero-downtime deployment for all processes (or comma-separated process-type list) ***WARNING: this will cause downtime during deployments***
checks:enable <app> [process-type(s)] Enable zero-downtime deployment for all processes (or comma-separated process-type list)
checks:skip <app> [process-type(s)] Skip zero-downtime checks for all processes (or comma-separated process-type list)
```
Following a deploy, dokku will wait `10` seconds before routing traffic to the new container to give your application time to boot up. If the application is not running after this time, then the deploy is failed and your old container will continue serving traffic. You can modify this value globally or on a per-application basis:
```shell
dokku config:set --global DOKKU_DEFAULT_CHECKS_WAIT=30
dokku config:set <app> DOKKU_DEFAULT_CHECKS_WAIT=30
```
If your application needs a longer period to boot up - perhaps to load data into memory, or because of slow boot time - you may also use dokku's `checks` functionality to more precisely check whether an application can serve traffic or not.
To specify checks, add a `CHECKS` file to the root of your project directory. This is a text file with one line per check. Empty lines and lines starting with `#` are ignored.
A check is a relative URL and may be followed by expected content from the page, for example:
```
/about Our Amazing Team
```
Dokku will wait `5` seconds before running the checks to give the server time to start. This value can be overridden on a per-app basis in the `CHECKS` file by setting `WAIT=nn`. You may also override this for the global dokku installation:
You can also choose to skip checks or disable zero-downtime completely on a per-application/per-process basis:
```shell
dokku config:set --global DOKKU_CHECKS_WAIT=15
dokku checks:skip <app> worker,web
```
Dokku will wait `60` seconds before stopping the old container so that existing connections are given a chance to complete. This value is also configurable globally:
```shell
dokku checks:disable <app> worker,web
```
> Note that `checks:disable` will now (as of 0.6.0) cause downtime for that process-type during deployments.
Additionally, any given process can only be configured to skip OR disable zero-downtime. example:
```shell
$ dokku checks:skip testapp worker,web
-----> Skipping zero downtime for app's (testapp) proctypes (worker,web)
-----> Unsetting testapp
-----> Unsetting DOKKU_CHECKS_DISABLED
-----> Setting config vars
DOKKU_CHECKS_SKIPPED: worker,web
$ dokku checks:disable testapp worker
-----> Disabling zero downtime for app's (testapp) proctypes (worker)
-----> Setting config vars
DOKKU_CHECKS_DISABLED: worker
-----> Setting config vars
DOKKU_CHECKS_SKIPPED: web
```
Dokku will wait `60` seconds before stopping the old container so that existing connections are given a chance to complete. You can modify this value globally or on a per-application basis:
```shell
dokku config:set --global DOKKU_WAIT_TO_RETIRE=120
dokku config:set <app> DOKKU_WAIT_TO_RETIRE=120
```
> Note that during this time, multiple containers may be running on your server, which can be an issue for memory-hungry applications on memory-constrained servers.
Dokku will retry the checks `5` times until the checks are successful. If all 5 checks fail, the deployment is considered failed. This can be overridden in the `CHECKS` file by setting `ATTEMPTS=nn`. This number is also configurable globally:
## Checks
```shell
dokku config:set --global DOKKU_CHECKS_ATTEMPTS=2
If your application needs a longer period to boot up - perhaps to load data into memory, or because of slow boot time - you may also use dokku's `checks` functionality to more precisely check whether an application can serve traffic or not.
Checks are run against the detected `web` process from your application's `Procfile`. For non-web processes, dokku will fallback to the aforementioned process uptime check.
To specify checks, add a `CHECKS` file to the root of your project directory. The `CHECKS` file should be plain text and may contain:
* Check instructions
* Settings (NAME=VALUE)
* Comments (lines starting with #)
* Empty lines
> For dockerfile-based deploys, the file *must* be in `/app/CHECKS` within the container. `/app` is used by default as the root container directory for buildpack-based deploys.
### Check Instructions
The format of a check instruction is a path or relative URL, optionally followed by the expected content:
```
/about Our Amazing Team
```
You can also choose to skip checks completely either globally or on a per-application basis:
```shell
# globally
dokku config:set --global DOKKU_SKIP_ALL_CHECKS=true
# for APP
dokku config:set APP DOKKU_SKIP_ALL_CHECKS=true
```
## Checks Examples
The CHECKS file may contain empty lines, comments (lines starting with #),
settings (NAME=VALUE) and check instructions.
The format of a check instruction is a path, optionally followed by the
expected content. For example:
The `CHECKS` file can contain multiple checks:
```
/ My Amazing App
@@ -63,50 +85,65 @@ expected content. For example:
/images/logo.png
```
To check an application that supports multiple hostnames, use relative URLs
that include the hostname, for example:
To check an application that supports multiple hostnames, use relative URLs that include the hostname:
```
//admin.example.com Admin Dashboard
//admin.example.com Admin Dashboard
//static.example.com/logo.png
```
You can also specify the protocol to explicitly check HTTPS requests.
You can also specify the protocol to explicitly check HTTPS requests:
```
https://admin.example.com Admin Dashboard
https://admin.example.com Admin Dashboard
https://static.example.com/logo.png
```
The default behavior is to wait for 5 seconds before running the first check, and timeout each check to 30 seconds.
### Check Settings
By default, checks will be attempted 5 times. (Retried 4 times)
The default behavior is to wait for `5` seconds before running the checks, to timeout the checks after `30` seconds, and to attempt the checks `5` times. If the checks fail `5` times, the deployment is considered failed and the old container will continue serving traffic.
You can change these by setting `WAIT`, `TIMEOUT` and `ATTEMPTS` to different values, for
example:
You can change the default behavior by setting `WAIT`, `TIMEOUT`, and `ATTEMPTS` to different values in the `CHECKS` file:
```
WAIT=30 # Wait 1/2 minute
TIMEOUT=60 # Timeout after a minute
ATTEMPTS=10 # attempt checks 10 times
ATTEMPTS=10 # Attempt checks 10 times
/ My Amazing App
/ My Amazing App
```
You can also override the default `WAIT`, `TIMEOUT`, and `ATTEMPTS` variables for the global dokku installation:
```shell
dokku config:set --global DOKKU_CHECKS_WAIT=30
dokku config:set --global DOKKU_CHECKS_TIMEOUT=60
dokku config:set --global DOKKU_CHECKS_ATTEMPTS=10
```
If your application runs multiple processes (a background worker configured in your `Procfile`, for example) and you have checks to ensure that your web application has booted up, you may want to disable the default check wait time for that application to avoid the `10` second wait per non-web process:
```shell
dokku config:set <app> DOKKU_DEFAULT_CHECKS_WAIT=0
```
## Example: Successful Rails Deployment
In this example, a rails applicaiton is successfully deployed to dokku. The initial round of checks fails while the server is starting, but once it starts they succeed and the deployment is successful. `ATTEMPTS` is set to 6, but the third attempt succeeds.
In this example, a Rails application is successfully deployed to dokku. The initial round of checks fails while the server is starting, but once it starts they succeed and the deployment is successful. `WAIT` is set to `10` because our application takes a while to boot up. `ATTEMPTS` is set to `6`, but the third attempt succeeds.
### CHECKS file
````
WAIT=5
WAIT=10
ATTEMPTS=6
/check.txt simple_check
/check.txt simple_check
````
> check.txt is a text file returning the string 'simple_check'
For this check to work, we've added a line to `config/routes.rb` that simply returns a string:
````
get '/check.txt', to: proc {[200, {}, ['simple_check']]}
````
### Deploy Output
@@ -129,19 +166,19 @@ git push dokku master
-----> Releasing myapp...
-----> Deploying myapp...
-----> Running pre-flight checks
-----> Attempt 1/6 Waiting for 5 seconds ...
-----> Attempt 1/6 Waiting for 10 seconds ...
CHECKS expected result:
http://localhost/check.txt => "simple_check"
!
curl: (7) Failed to connect to 172.17.0.155 port 5000: Connection refused
! Check attempt 1/6 failed.
-----> Attempt 2/6 Waiting for 5 seconds ...
-----> Attempt 2/6 Waiting for 10 seconds ...
CHECKS expected result:
http://localhost/check.txt => "simple_check"
!
curl: (7) Failed to connect to 172.17.0.155 port 5000: Connection refused
! Check attempt 2/6 failed.
-----> Attempt 3/6 Waiting for 5 seconds ...
-----> Attempt 3/6 Waiting for 10 seconds ...
CHECKS expected result:
http://localhost/check.txt => "simple_check"
-----> All checks successful!
@@ -165,14 +202,15 @@ curl: (7) Failed to connect to 172.17.0.155 port 5000: Connection refused
````
## Example: Failing Rails Deployment
In this example, a Rails application fails to deploy. The reason for the failure is that the postgres database connection fails. The initial checks will fail while we wait for the server to start up, just like in the above example. However, once the server does start accepting connections, we will see an error 500 due to the postgres database connection failure.
In this example, a Rails application fails to deploy. The reason for the failure is that the postgres database connection fails. The initial checks will fail while we wait for the server to start up, just like in the above example. However, once the server does start accepting connections, we will see an error 500 due to the postgres database connection failure.
Once the attempts have been exceeded, the deployment fails and we see the container output, which shows the Postgres connection errors.
### CHECKS file
````
WAIT=5
WAIT=10
ATTEMPTS=6
/
````
@@ -200,37 +238,37 @@ Procfile declares types -> web
Releasing myapp...
Deploying myapp...
Running pre-flight checks
-----> Attempt 1/6 Waiting for 5 seconds ...
-----> Attempt 1/6 Waiting for 10 seconds ...
CHECKS expected result:
http://localhost/ => ""
!
curl: (7) Failed to connect to 172.17.0.188 port 5000: Connection refused
! Check attempt 1/6 failed.
-----> Attempt 2/6 Waiting for 5 seconds ...
-----> Attempt 2/6 Waiting for 10 seconds ...
CHECKS expected result:
http://localhost/ => ""
!
curl: (7) Failed to connect to 172.17.0.188 port 5000: Connection refused
! Check attempt 2/6 failed.
-----> Attempt 3/6 Waiting for 5 seconds ...
-----> Attempt 3/6 Waiting for 10 seconds ...
CHECKS expected result:
http://localhost/ => ""
!
curl: (22) The requested URL returned error: 500 Internal Server Error
! Check attempt 3/6 failed.
-----> Attempt 4/6 Waiting for 5 seconds ...
-----> Attempt 4/6 Waiting for 10 seconds ...
CHECKS expected result:
http://localhost/ => ""
!
curl: (22) The requested URL returned error: 500 Internal Server Error
! Check attempt 4/6 failed.
-----> Attempt 5/6 Waiting for 5 seconds ...
-----> Attempt 5/6 Waiting for 10 seconds ...
CHECKS expected result:
http://localhost/ => ""
!
curl: (22) The requested URL returned error: 500 Internal Server Error
! Check attempt 5/6 failed.
-----> Attempt 6/6 Waiting for 5 seconds ...
-----> Attempt 6/6 Waiting for 10 seconds ...
CHECKS expected result:
http://localhost/ => ""
!
@@ -259,8 +297,15 @@ Could not start due to 1 failed checks.
vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `new'
vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `postgresql_connection
=====> end myapp container output
/usr/local/bin/dokku: line 49: 23409 Killed dokku deploy "$APP"
/usr/bin/dokku: line 49: 23409 Killed dokku deploy "$APP"
To dokku@dokku.example.com:myapp
! [remote rejected] dokku -> master (pre-receive hook declined)
error: failed to push some refs to 'dokku@dokku.example.com:myapp'
````
### Configuring docker stop timeout
[By default](https://docs.docker.com/engine/reference/commandline/stop/), docker will wait 10 seconds from the time the `stop` command is passed to a container before it attempts to kill said container. This timeout can be configured on a per-app basis in dokku by setting the `DOKKU_DOCKER_STOP_TIMEOUT` configuration variable. This timeout applies to normal zero-downtime deployments as well as the `ps:stop` and `apps:destroy` commands.
```
$ dokku config:set $APP DOKKU_DOCKER_STOP_TIMEOUT=20
```

View File

@@ -13,6 +13,10 @@ To install, simply clone the dokku repository down and add the `dokku` alias poi
```shell
git clone git@github.com:dokku/dokku.git ~/.dokku
# optional: make sure that the dokku_client.sh version matches your dokku version
cd ~/.dokku
git checkout <tag/branch>
# add the following to either your
# .bashrc, .bash_profile, or .profile file
alias dokku='$HOME/.dokku/contrib/dokku_client.sh'
@@ -33,6 +37,8 @@ alias dokku 'bash $HOME/.dokku/contrib/dokku_client.sh'
Configure the `DOKKU_HOST` environment variable or run `dokku` from a repository with a git remote named dokku pointed at your dokku host in order to use the script as normal.
You can also configure a `DOKKU_PORT` environment variable if you are running ssh on a non-standard port. This defaults to `22`.
## (nodejs) dokku-toolbelt
Dokku-toolbelt is a node-based cli wrapper that proxies requests to the dokku command running on remote hosts. You can install it via the following shell command (assuming you have nodejs and npm installed):

View File

@@ -11,7 +11,7 @@ config:set (<app>|--global) KEY1=VALUE1 [KEY2=VALUE2 ...] Set one or more config
config:unset (<app>|--global) KEY1 [KEY2 ...] Unset one or more config vars
```
The variables are available both at run time and during the application build/compilation step.
The variables are available both at run time and during the application build/compilation step for buildpack-based deploys. For security reasons - and as per [docker recommendations](https://github.com/docker/docker/issues/13490) - Dockerfile-based deploys have variables available *only* during runtime, as noted in [this issue](https://github.com/dokku/dokku/issues/1860).
> Note: Global `ENV` files are sourced before app-specific `ENV` files. This means that app-specific variables will take precedence over global variables. Configuring your global `ENV` file is manual, and should be considered potentially dangerous as configuration applies to all applications.

View File

@@ -16,6 +16,9 @@ To use a specific buildpack, you can run the following dokku command:
# replace APP with the name of your application
# replace REPOSITORY_URL with your buildpack's url
dokku config:set APP BUILDPACK_URL=REPOSITORY_URL
# example: using a specific ruby buildpack version
dokku config:set APP BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git#v142
```
Please check the documentation for your particular buildpack as you may need to include configuration files (such as a Procfile) in your project root.
@@ -25,10 +28,12 @@ Please check the documentation for your particular buildpack as you may need to
You can only set a single buildpack using the `BUILDPACK_URL`, though there may be times when you wish to use multiple buildpacks. To do so, simply create a `.buildpacks` file in the base of your repository. This file should list all the buildpacks, one-per-line. For instance, if you wish to use both the `nodejs` and `ruby` buildpacks, your `.buildpacks` file should contain the following:
```shell
https://github.com/heroku/heroku-buildpack-nodejs.git
https://github.com/heroku/heroku-buildpack-ruby.git
https://github.com/heroku/heroku-buildpack-nodejs.git#v87
https://github.com/heroku/heroku-buildpack-ruby.git#v142
```
> Always remember to pin your buildpack versions when using the multi-buildpacks method, or you may find deploys changing your deployed environment.
You may also choose to set just a single buildpack in this file, though that is up to you.
Please check the documentation for your particular buildpack(s) as you may need to include configuration files (such as a Procfile) in your project root.
@@ -51,6 +56,31 @@ You may also wish to use a **specific** version of a buildpack, which is also si
dokku config:set APP BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-nodejs#v87
```
## Specifying commands via Procfile
While many buildpacks have a default command that is run when a detected repository is pushed, it is possible to override this command via a Procfile. A Procfile can also be used to specify multiple commands, each of which is subject to process scaling. See the [process scaling documentation](/dokku/process-management/) for more details around scaling individual processes.
A Procfile is a file named `Procfile`. It should be named `Procfile` exactly, and not anything else. For example, `Procfile.txt` is not valid. The file should be a simple text file.
The file must be placed in the root directory of your application. It will not function if placed in a subdirectory.
If the file exists, it should not be empty, as doing so may result in a failed deploy.
The syntax for declaring a `Procfile` is as follows. Note that the format is one process type per line, with no duplicate process types.
```
<process type>: <command>
```
If, for example, you have multiple queue workers and wish to scale them separately, the following would be a valid way to work around the requirement of not duplicating process types:
```
worker: env QUEUE=* bundle exec rake resque:work
importantworker: env QUEUE=important bundle exec rake resque:work
```
The `web` process type holds some significance in that it is the only process type that is automatically scaled to `1` on the initial application deploy. See the [process scaling documentation](/dokku/process-management/) for more details around scaling individual processes.
## Clearing buildpack cache
Building containers with buildpacks currently results in a persistent `cache` directory between deploys. If you need to clear this cache directory for any reason, you may do so by running the following shell command:
@@ -60,7 +90,7 @@ Building containers with buildpacks currently results in a persistent `cache` di
sudo rm -rf /home/dokku/APP/cache/*
```
### Curl Build Timeouts
## Curl Build Timeouts
Certain buildpacks may time out in retrieving dependencies via curl. This can happen when your network connection is poor or if there is significant network congestion. You may see a message similar to `gzip: stdin: unexpected end of file` after a curl command.

View File

@@ -0,0 +1,57 @@
# Deployment Tasks
> New as of 0.5.0
Sometimes you need to run a command on at deployment time, but before an app is completely deployed.
Common use cases include:
* Checking a database is initialised
* Running database migrations
* Any commands required to set up the server (e.g. something like a Django `collectstatic`)
## `app.json` and `scripts.dokku`
Dokku accomplishes this by using an `app.json` file. We (mostly) use the same format as Heroku's [app.json](https://devcenter.heroku.com/articles/app-json-schema).
However, dokku currently only supports the nodes `scripts.dokku.predeploy` and `scripts.dokku.postdeploy`.
Simply place an `app.json` file in the root of your repository or for dockerfile apps, `ADD` it to /app.
>NOTE: postdeploy changes are *NOT* committed to the app image.
### Example app.json
```
{
"name": "barebones nodejs",
"description": "A barebones Node.js app using Express 4.",
"keywords": [
"nodejs",
"express"
],
"repository": "https://github.com/michaelshobbs/node-js-sample",
"scripts": {
"dokku": {
"predeploy": "touch /app/predeploy.test",
"postdeploy": "curl https://some.external.api.service.com/deployment?state=success"
}
},
"env": {
"SECRET_TOKEN": {
"description": "A secret key for verifying the integrity of signed cookies.",
"value": "secret"
},
"WEB_CONCURRENCY": {
"description": "The number of processes to run.",
"generator": "echo 5"
}
},
"image": "gliderlabs/herokuish",
"addons": [
"dokku-postgres",
"dokku-redis"
],
"buildpacks": [
{
"url": "https://github.com/heroku/heroku-buildpack-nodejs"
}
]
}
```

View File

@@ -4,6 +4,8 @@
While Dokku normally defaults to using [heroku buildpacks](https://devcenter.heroku.com/articles/buildpacks) for deployment, you can also use docker's native `Dockerfile` system to define a container.
> Dockerfile support is considered a **Power User** feature. By using Dockerfile-based deployment, you agree that you will not have the same comfort as that enjoyed by Buildpack users, and Dokku features may work differently. Differences between the two systems will be documented here.
To use a dockerfiles for deployment, commit a valid `Dockerfile` to the root of your repository and push the repository to your Dokku installation. If this file is detected, Dokku will default to using it to construct containers **except** in the following two cases:
- The application has a `BUILDPACK_URL` environment variable set via the `dokku config:set` command or in a committed `.env` file. In this case, Dokku will use your specified buildpack.
@@ -11,16 +13,15 @@ To use a dockerfiles for deployment, commit a valid `Dockerfile` to the root of
## Exposed ports
By default, Dokku will extract the first `EXPOSE` tcp port and use said port with nginx to proxy your app to that port. For applications that have multiple ports exposed, you may override this port via the following command:
> Changed as of 0.5.0
```shell
# replace APP with the name of your application
dokku config:set APP DOKKU_DOCKERFILE_PORT=8000
```
Dokku will extract all tcp ports exposed using the `EXPOSE` directive (one port per line) and setup nginx to proxy the same port numbers to listen publicly. If you would like to change the exposed port, you should do so within your `Dockerfile` and app.
Dokku will not expose other ports on your application without a [custom docker-option](/dokku/docker-options/).
> NOTE: Nginx does not support proxying UDP. UDP ports can be exposed by disabling the nginx proxy with `dokku proxy:disable myapp`
If you do not have a port explicitly exposed, Dokku will automatically expose port `5000` for your application.
If you do not explicitly `EXPOSE` a port in your `Dockerfile`, dokku will configure the nginx proxy to listen on port 80 (and 443 for TLS) and forward traffic to your app listening on port 5000 inside the container. Just like buildpack apps, you can also use the `$PORT` environment variable in your app to maintain portability.
When ports are exposed through the default nginx proxy, they are proxied externally as HTTP ports. At this time, in no case do we proxy plain TCP or UDP ports. If you'd like to investigate alternative proxy methods, please refer to our [proxy documentation](/dokku/proxy/).
## Customizing the run command
@@ -39,3 +40,35 @@ dokku config:set APP DOKKU_DOCKERFILE_START_CMD="--harmony server.js"
To tell docker what to run.
Setting `$DOKKU_DOCKERFILE_CACHE_BUILD` to `true` or `false` will enable or disable docker's image layer cache. Lastly, for more granular build control, you may also pass any `docker build` option to `docker`, by setting `$DOKKU_DOCKER_BUILD_OPTS`.
### Procfiles and Multiple Processes
> New as of 0.5.0
You can also customize the run command using a `Procfile`, much like you would on Heroku or
with a buildpack deployed app. The `Procfile` should contain one or more lines defining [process
types and associated commands](https://devcenter.heroku.com/articles/procfile#declaring-process-types).
When you deploy your app a Docker image will be built, the `Procfile` will be extracted from the image
(it must be in the folder defined in your `Dockerfile` as `WORKDIR` or `/app`) and the commands
in it will be passed to `docker run` to start your process(es). Here's an example `Procfile`:
```
web: bin/run-prod.sh
worker: bin/run-worker.sh
```
And `Dockerfile`:
```
FROM debian:jessie
WORKDIR /app
COPY . ./
CMD ["bin/run-dev.sh"]
```
When you deploy this app the `web` process will automatically be scaled to 1 and your Docker container
will be started basically using the command `docker run bin/run-prod.sh`. If you want to also run
a worker container for this app, you can run `dokku ps:scale worker=1` and a new container will be
started by running `docker run bin/run-worker.sh` (the actual `docker run` commands are a bit more
complex, but this is the basic idea). If you use an `ENTRYPOINT` in your `Dockerfile`, the lines
in your `Procfile` will be passed as arguments to the `ENTRYPOINT` script instead of being executed.

View File

@@ -0,0 +1,98 @@
# Domain Configuration
> New as of 0.3.10
```shell
domains:add <app> DOMAIN Add a domain to app
domains [<app>] List domains
domains:clear <app> Clear all domains for app
domains:disable <app> Disable VHOST support
domains:enable <app> Enable VHOST support
domains:remove <app> DOMAIN Remove a domain from app
domains:set-global <domain> Set global domain name
```
## Customizing hostnames
Applications typically have the following structure for their hostname:
```
scheme://subdomain.domain.tld
```
The `subdomain` is inferred from the pushed application name, while the `domain.tld` is set during initial configuration and stored in the `$DOKKU_ROOT/VHOST` file. It can then be modified with `dokku domains:set-global`. This value is used as a default TLD for all applications on a host.
If a FQDN such as `other.tld` is used as the application name, the default `$DOKKU_ROOT/VHOST` will be ignored and the resulting vhost URL for that application will be `other.tld`. The exception to this rule being that if the FQDN has the same ending as the default vhost (such as `subdomain.domain.tld`), then the entire FQDN will be treated as a subdomain. The application will therefore be deployed at `subdomain.domain.tld.domain.tld`.
You can optionally override this in a plugin by implementing the `nginx-hostname` plugin trigger. For example, you can reverse the subdomain with the following sample `nginx-hostname` plugin trigger:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
APP="$1"; SUBDOMAIN="$2"; VHOST="$3"
NEW_SUBDOMAIN=`echo $SUBDOMAIN | rev`
echo "$NEW_SUBDOMAIN.$VHOST"
```
If the `nginx-hostname` has no output, the normal hostname algorithm will be executed.
## Disabling VHOSTS
If desired, it is possible to disable vhosts with the domains plugin.
```shell
dokku domains:disable myapp
```
On subsequent deploys, the nginx virtualhost will be discarded. This is useful when deploying internal-facing services that should not be publicly routeable. As of 0.4.0, nginx will still be configured to proxy your app on some random high port. This allows internal services to maintain the same port between deployments. You may change this port by setting `DOKKU_NGINX_PORT` and/or `DOKKU_NGINX_SSL_PORT` (for services configured to use SSL.)
The domains plugin allows you to specify custom domains for applications. This plugin is aware of any ssl certificates that are imported via `certs:add`. Be aware that disabling domains (with `domains:disable`) will override any custom domains.
```shell
# where `myapp` is the name of your app
# add a domain to an app
dokku domains:add myapp example.com
# list custom domains for app
dokku domains myapp
# clear all custom domains for app
dokku domains:clear myapp
# remove a custom domain from app
dokku domains:remove myapp example.com
```
## Default site
By default, dokku will route any received request with an unknown HOST header value to the lexicographically first site in the nginx config stack. If this is not the desired behavior, you may want to add the following configuration to the global nginx configuration. This will catch all unknown HOST header values and return a `410 Gone` response. You can replace the `return 410;` with `return 444;` which will cause nginx to not respond to requests that do not match known domains (connection refused).
```
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
return 410;
log_not_found off;
}
```
You may also wish to use a separate vhost in your `/etc/nginx/sites-enabled` directory. To do so, create the vhost in that directory as `/etc/nginx/sites-enabled/00-default.conf`. You will also need to change two lines in the main `nginx.conf`:
```
# Swap both conf.d include line and the sites-enabled include line. From:
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
# to the following
include /etc/nginx/sites-enabled/*;
include /etc/nginx/conf.d/*.conf;
```
Alternatively, you may push an app to your dokku host with a name like "00-default". As long as it lists first in `ls /home/dokku/*/nginx.conf | head`, it will be used as the default nginx vhost.

View File

@@ -55,3 +55,70 @@ root@dokku:~# dokku tags:deploy node-js-app v0.9.0
http://node-js-app.dokku.me
```
## Deploying from a Docker Registry
You can alternatively add image pulled from a docker Registry and deploy app from it by using tagging feature. In this example, we are deploying from Docker Hub.
1. Create dokku app as usual
```shell
dokku apps:create test-app
```
2. Pull image from Docker Hub
```shell
docker pull demo-repo/some-image:v12
```
3. Retag the image to match the created app
```shell
docker tag demo-repo/some-image:v12 dokku/test-app:v12
```
4. Deploy tag
```shell
dokku tags:deploy test-app v12
```
> Note: When deploying an image, we will use `docker inspect` to extract the `ExposedPorts` configuration and if defined, use that to populate `DOKKU_DOCKERFILE_PORTS`. If this behavior is not desired, you can override that configuration variable with the `config:set` command.
> Example: `dokku config:set test-app DOKKU_DOCKERFILE_PORTS="5984/tcp 80/tcp"`
## Deploying an image from CI
To ensure your builds are always reproducible, it's considered bad practice to store build
artifacts in your repository. For some projects however, building artifacts during deployment
to dokku may affect the performance of running applications.
One solution is to build a finished Docker image on a CI service (or even locally) and deploy
it directly to the host running dokku.
1. Build image on CI (or locally)
```shell
docker build -t dokku/test-app:v12
# Note: The image must be tagged `dokku/<app-name>:<version>`
```
2. Deploy image to dokku host
```shell
docker save dokku/test-app:v12 | ssh my.dokku.host "docker load | dokku tags:deploy test-app v12"
```
> Note: You can also use a Docker Registry to push and pull
> the image rather than uploading it directly.
Here's a more complete example using the above method:
```shell
# build the image
docker build -t dokku/test-app:v12
# copy the image to the dokku host
docker save dokku/test-app:v12 | bzip2 | ssh my.dokku.host "bunzip2 | docker load"
# tag and deploy the image
ssh my.dokku.host "dokku tags:create test-app previous; dokku tags:deploy test-app v12 && dokku tags:create test-app latest"
```

View File

@@ -1,4 +1,4 @@
# One-off Processes
# One-off Processes and Cron
Sometimes you need to either inspect running containers or run a one-off command under an application. In those cases, Dokku makes it easy to either connect to a running container or run a fresh container.
@@ -15,6 +15,17 @@ The `run` command can be used to run a one-off process for a specific command. T
dokku run node-js-app ls -lah
```
The `run` command can also be used to run a command defined in your Procfile:
```
console: bundle exec racksh
```
```shell
# runs `bundle exec racksh` in the `/app` directory of the application `my-app`
dokku run my-app console
```
If you want to remove the container after a command has started, you can run the following command:
```shell
@@ -32,6 +43,15 @@ dokku --rm-container run node-js-app ls -lah
dokku --rm run node-js-app ls -lah
```
Finally, you may wish to run a container in "detached" mode via the `--detach` dokku flag. Running a process in detached mode will immediately return a `CONTAINER_ID`. It is up to the user to then further manage this container in whatever manner they see fit, as dokku will *not* automatically terminate the container.
```shell
dokku --detach run node-js-app ls -lah
# returns the ID of the new container
```
> Note that you may not use the `--rm-container` or `--rm` flags when running containers in detached mode, and attempting to do so will result in the `--detach` flag being ignored.
### Using `run` for cron tasks
You can always use a one-off container to run an application task:
@@ -59,6 +79,8 @@ dokku enter node-js-app web.1
dokku enter node-js-app --container-id ID
```
Additionally, you can run `enter` with no container-type. If only a single container-type is defined in your app, you will be dropped into the only running container. This behavior is not supported when specifying a custom command; as described below.
By default, it runs a `/bin/bash`, but can also be used to run a custom command:
```shell
@@ -74,7 +96,7 @@ dokku enter node-js-app web python script/background-worker.py
Your procfile can have the following entry:
```
cron: while true; do sleep 10; done
cron: sleep infinity
```
With the `cron` process scaled to `1`:
@@ -97,6 +119,8 @@ For tasks that will properly resume, you **should** use the above method, as run
Regularly scheduled tasks can be a bit of a pain with dokku. The following are general recommendations to follow to help ensure successful task runs.
- Use the dokku user's crontab
- If you do not, dokku will attempt to execute with sudo dokku, and your cron run with fail with `sudo: no tty present and no askpass program specified`
- Add a `MAILTO` environment variable to ship cron emails to yourself.
- Add a `PATH` environment variable or specify the full path to binaries on the host.
- Add a `SHELL` environment variable to specify bash when running commands.

View File

@@ -35,6 +35,12 @@ dokku certs:add <app> < cert-key.tar
cat yourdomain_com.crt yourdomain_com.ca-bundle > server.crt
```
#### SSL and Multiple Domains
When an SSL certificate is associated to an application, the certificate will be associated with *all* domains currently associated with said application. Your certificate _should_ be associated with all of those domains, otherwise accessing the application will result in SSL errors. If you wish to remove one of the domains from the application, refer to the [domain configuration documentation](/dokku/deployment/domain-configuration/).
Note that with the default nginx template, requests will be redirected to the `https` version of the domain. If this is not the desired state of request resolution, you may customize the nginx template in use. For more details, see the [nginx documentation](/dokku/nginx/).
### Certificate generation
> Note: Using this method will create a self-signed certificate, which is only recommended for development or staging use, not production environments.
@@ -64,34 +70,6 @@ root@dokku:~/dokku# dokku certs:info node-js-app
The `certs:remove` command only works on app-specific certificates. It will `rm` the app-specific tls directory, rebuild the nginx configuration, and reload nginx.
## Global Certification
Global certificate management is a manual process. To enable TLS connections for all your applications at once you will need a wildcard TLS certificate.
To enable TLS across all apps, you can run the following commands:
```shell
mkdir -p /home/dokku/tls
cp server.crt /home/dokku/tls/server.crt
cp server.key /home/dokku/tls/server.key
```
Next, you will want to enable the certificates by editing `/etc/nginx/conf.d/dokku.conf` and uncommenting these two lines (remove the `#`):
```
ssl_certificate /home/dokku/tls/server.crt;
ssl_certificate_key /home/dokku/tls/server.key;
```
The settings will take affect at the next deploy. If you would like to propagate the change to all apps immediately, you can also run the following command:
```shell
dokku ps:restartall
```
Once TLS is enabled, the application will be accessible by `https://` (redirection from `http://` is applied as well).
> Note: TLS will not be enabled unless the application's VHOST matches the certificate's name. (i.e. if you have a cert for `*.example.com` TLS won't be enabled for `something.example.org` or `example.net`)
## HSTS Header
@@ -101,14 +79,40 @@ Beware that if you enable the header and a subsequent deploy of your application
## Running behind a load balancer
> New as of 0.3.17
Your application has access to the HTTP headers `X-Forwarded-Proto`, `X-Forwarded-For` and `X-Forwarded-Port`. These headers indicate the protocol of the original request (HTTP or HTTPS), the port number, and the IP address of the client making the request, respectively. The default configuration is for Nginx to set these headers.
If your server runs behind an HTTP/S load balancer, then Nginx will see all requests as coming from the load balancer. If your load balancer sets the `X-Forwarded-` headers, you can tell Nginx to pass these headers from load balancer to your application by setting the `DOKKU_SSL_TERMINATED` environment variable:
If your server runs behind an HTTP/S load balancer, then Nginx will see all requests as coming from the load balancer. If your load balancer sets the `X-Forwarded-` headers, you can tell Nginx to pass these headers from load balancer to your application by using the following [nginx custom template](/dokku/nginx/#customizing-the-nginx-configuration)
```shell
dokku config:set myapp DOKKU_SSL_TERMINATED=1
server {
listen [::]:{{ .NGINX_PORT }};
listen {{ .NGINX_PORT }};
server_name {{ .NOSSL_SERVER_NAME }};
access_log /var/log/nginx/{{ .APP }}-access.log;
error_log /var/log/nginx/{{ .APP }}-error.log;
# set a custom header for requests
add_header X-Served-By www-ec2-01;
location / {
proxy_pass http://{{ .APP }};
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
proxy_set_header X-Forwarded-Port $http_x_forwarded_port;
proxy_set_header X-Request-Start $msec;
}
include {{ .DOKKU_ROOT }}/{{ .APP }}/nginx.conf.d/*.conf;
}
upstream {{ .APP }} {
{{ range .DOKKU_APP_LISTENERS | split " " }}
server {{ . }};
{{ end }}
}
```
Only use this option if:

View File

@@ -0,0 +1,48 @@
# User Management
While it is possible to use password-based authorization to push to Dokku, it is preferable to use key-based authentication for security.
Users in dokku are managed via the `~/dokku/.ssh/authorized_keys` file. While you *can* manually edit this file, it is **highly** recommended that you follow the below steps to manage users on a dokku server.
## SSHCommand
Dokku uses the [`sshcommand`](https://github.com/dokku/sshcommand) utility to manage ssh keys for the dokku user. The following is the usage output for sshcommand.
```
sshcommand create <user> <command> # creates a user forced to run command when SSH connects
sshcommand acl-add <user> <ssh-key-name> # adds named SSH key to user from STDIN
sshcommand acl-remove <user> <ssh-key-name> # removes SSH key by name
sshcommand help # displays the usage help message
```
In dokku's case, the `<user>` section is *always* `dokku`, as this is the system user that the dokku binary performs all it's actions. Keys are given unique names, which can be used in conjunction with the [user-auth](/dokku/development/plugin-triggers/#user-auth) plugin trigger to handle command authorization.
## Adding deploy users
You can add your public key to the dokku user's `~/dokku/.ssh/authorized_keys` file with the following command:
```shell
# from your local machine
# replace dokku.me with your domain name or the host's IP
# replace root with your server's root user
# USER is the username you use to refer to this particular key
cat ~/.ssh/id_rsa.pub | ssh root@dokku.me "sudo sshcommand acl-add dokku USER"
```
At it's base, the `sshcommand` *must* be run under a user with sudo access, as it sets keys for the dokku user.
For instance, if you stored your public key at `~/.ssh/id_rsa.pub-open` and are deploying to EC2 where the default root-enabled user is `ubuntu`, you can run the following command to add your key under the `superuser` username:
```
cat ~/.ssh/id_rsa.pub-open | ssh ubuntu@dokku.me "sudo sshcommand acl-add dokku superuser"
```
If you are using the vagrant installation, you can also use the `make vagrant-acl-add` target to add your public key to dokku (it will use your host username as the `USER`):
```
cat ~/.ssh/id_rsa.pub | make vagrant-acl-add
```
## Scoping commands to specific users
See the [user auth plugin trigger documentation](/dokku/development/plugin-triggers/#user-auth).

View File

@@ -3,38 +3,102 @@
If you create your own plugin:
1. Take a look at the plugins shipped with dokku and hack away!
2. Check out the [list of triggers](http://dokku.viewdocs.io/dokku/development/plugin-triggers) your plugin can implement.
2. Check out the [list of triggers](/dokku/development/plugin-triggers) your plugin can implement.
3. Upload your plugin to github with a repository name in form of `dokku-<name>` (e.g. `dokku-mariadb`)
4. Edit [this page](http://dokku.viewdocs.io/dokku/plugins) and add a link to it.
4. Edit [this page](/dokku/plugins) and add a link to it.
5. Subscribe to the [dokku development blog](http://progrium.com) to be notified about API changes and releases
### Sample plugin
The below plugin is a dummy `dokku hello` plugin. If your plugin exposes commands, this is a good template for your `commands` file:
### Sample plugin
The below plugin is a dummy `dokku hello` plugin.
hello/subcommands/default
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
hello_main_cmd() {
declare desc="prints Hello \$APP"
local cmd="hello"
# Support --app/$DOKKU_APP_NAME flag
# Use the following lines to reorder args into "$cmd $DOKKU_APP_NAME $@""
local argv=("$@")
[[ ${argv[0]} == "$cmd" ]] && shift 1
[[ ! -z $DOKKU_APP_NAME ]] && set -- $DOKKU_APP_NAME $@
set -- $cmd $@
##
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
verify_app_name "$2"
local APP="$2";
echo "Hello $APP"
}
hello_main_cmd "$@"
```
hello/subcommands/world
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
hello_world_cmd() {
declare desc="prints Hello World"
local cmd="hello:world"
# Support --app/$DOKKU_APP_NAME flag
# Use the following lines to reorder args into "$cmd $DOKKU_APP_NAME $@""
local argv=("$@")
[[ ${argv[0]} == "$cmd" ]] && shift 1
[[ ! -z $DOKKU_APP_NAME ]] && set -- $DOKKU_APP_NAME $@
set -- $cmd $@
##
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
verify_app_name "$2"
local APP="$2";
echo "Hello world"
}
hello_world_cmd "$@"
```
hello/commands
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
case "$1" in
hello)
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
APP="$2"; IMAGE_TAG=$(get_running_image_tag $APP); IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
verify_app_name "$APP"
echo "Hello $APP"
;;
hello:world)
echo "Hello world"
;;
help)
cat<<EOF
help | hello:help)
help_content_func () {
declare desc="return help_content string"
cat<<help_content
hello <app>, Says "Hello <app>"
hello:world, Says "Hello world"
EOF
help_content
}
if [[ $1 = "hello:help" ]] ; then
echo -e 'Usage: dokku hello[:world] [<app>]'
echo ''
echo 'Say Hello World.'
echo ''
echo 'Example:'
echo ''
echo '$ dokku hello:world'
echo 'Hello world'
echo ''
echo 'Additional commands:'
help_content_func | sort | column -c2 -t -s,
else
help_content_func
fi
;;
*)
@@ -89,5 +153,6 @@ A few notes:
dokku config:unset --no-restart APP KEY1 [KEY2 ...]
```
- From time to time you may want to allow other plugins access to (some of) your plugin's functionality. You can expose this by including a `functions` file in your plugin for others to source. Consider all functions in that file to be publicly accessible by other plugins. Any functions not wished to be made "public" should reside within your plugin trigger or commands files.
- As of 0.4.0, we allow image tagging and deployment of said tagged images. Therefore, hard-coding of `$IMAGE` as `dokku/$APP` is no longer sufficient. Instead, for non `pre/post-build-*` plugins, use `get_running_image_tag()` & `get_app_image_name()` as sourced from common/functions. See the [plugin triggers](http://dokku.viewdocs.io/dokku/development/plugin-triggers) doc for examples.
- As of 0.4.0, we allow image tagging and deployment of said tagged images. Therefore, hard-coding of `$IMAGE` as `dokku/$APP` is no longer sufficient. Instead, for non `pre/post-build-*` plugins, use `get_running_image_tag()` & `get_app_image_name()` as sourced from common/functions. See the [plugin triggers](/dokku/development/plugin-triggers) doc for examples.
- As of 0.5.0, we use container labels to help cleanup intermediate containers with `dokku cleanup`. If manually calling `docker run`, include `$DOKKU_GLOBAL_RUN_ARGS`. This will ensure you intermediate containers labeled correctly.
- As of 0.6.0, we advise you to *not* call the dokku binary directly from within plugins. Clients using the `--app` argument are potentially broken, amongst other issues, when doing so. Instead, please source the `functions` file for a given plugin when attempting to call dokku internal functions

File diff suppressed because it is too large Load Diff

View File

@@ -4,10 +4,10 @@ Dokku is released in intervals *at most* three weeks apart, though may be releas
To propose a release, the following tasks need to be performed:
- Update all blockquote references of `not yet released and only available in master` to point to release version.
- The installable version must be changed in the `contrib/dokku-installer.py` file.
- The installable version must be changed in the `debian/control` file.
- The installable version must be changed in the `docs/home.html` file
- The installable version must be changed in the `docs/index.md` file
- The installable version must be changed in the `docs/installation.md` file.
- The installable version must be changed in the `docs/template.html` file.
- The installable version must be changed in the `README.md` file.
@@ -17,12 +17,13 @@ To propose a release, the following tasks need to be performed:
- The versioned links should be updated in the `docs/assets/style.css` file.
- The versioned links should be updated in the `docs/home.html` file.
- The versioned links should be updated in the `docs/template.html` file.
- The versioned links should be updated in the `docs/template.html` file.
- The versioned links should be updated or added to the `docs/assets/versions.json` file.
- A list of changes must be made in the `HISTORY.md`.
- A tag must be created locally with your release version
- Debian packages *must* be created via `vagrant up build`
- The packages should be uploaded to packagecloud.io
- All changes are pushed to master and the tag should be turned into a release which will contain the changelog.
- ArchLinux package description *must* be updated via `vagrant up build-arch` (needs to be done after the tag is pushed to GitHub, because it is based on that)
## Versioning
@@ -56,6 +57,24 @@ If new versions of other packages were created, these should also be pushed at t
> If you are a maintainer and need the PACKAGECLOUD_TOKEN in order to make a release, please contact @josegonzalez to get this information.
## ArchLinux Packages
ArchLinux packages are not really build, because all that is needed for an Arch User Repo (AUR) package is the description of how to build the package. To make this process as easy as possible there is a vagrant box called `build-arch` that updates the version of this build description (a file called `PKGBUILD`), then runs some helper scripts to fill all additional information and does test if the package could be build. Then only those changes need to be pushed to the AUR repo and an updated version of the package is ready for usage for our ArchLinux users. For detailed information see the section below.
The workflow looks like this:
```shell
# having dokku-arch in ../dokku-arch
vagrant up build-arch
# wait for "==> build-arch: ==> Finished making: dokku 0.6.2-2 (Mon Feb 22 23:20:37 CET 2016)"
cd ../dokku-arch
git add PKGBUILD .SRCINFO
git commit -m 'Update to dokku 0.9.9'
git push aur master
```
> If you are a maintainer and need access to the AUR repositories in order to make a release, please contact @morrisjobke or @josegonzalez to get this co-maintainership.
## Changelog format
The `HISTORY.md` should be added to based on the changes made since the previous release. This can be done by reviewing all merged pull requests to the master branch on github. The format is as follows:
@@ -77,3 +96,28 @@ Some description concerning major changes in this release, or potential incompat
- #SOME_ID: @pull-request-creator Description
```
## Detailed information for ArchLinux packages
All of the information to build the ArchLinux package is in the AUR git repository (see [dokku AUR page](https://aur.archlinux.org/packages/dokku/)). The release of a AUR package only consists of pushing the package information into the AUR git repo. Then users could use that information to build the package on their machines.
To update the package clone the repository and adjust the files in the repository. Then a helper script - `updpkgsums` - to update the SHA sum could be called (check against the original SHA sum). Another helper script - `mksrcinfo` - needs to be called to update the meta information of the package in a file called `.SRCINFO`. The next step builds the package locally for verification - `makepkg`. As last step commit your changes and push the commit.
* dependencies are defined in the `depends` attribute in `PKGBUILD`
* build steps during package build time are defined in the `package()` method in `PKGBUILD`
* steps that should be executed during install/update/remove time are defined in the file `dokku.install`
* detailed information about all attributes in `PKGBUILD` could be found in the [ArchLinux wiki](https://wiki.archlinux.org/index.php/PKGBUILD)
* detailed information about the AUR workflow could be found in the [AUR article](https://wiki.archlinux.org/index.php/Arch_User_Repository) in the ArchLinux wiki
That is the usual workflow:
```shell
updpkgsums # update sha sums - compare them with the original ones
mksrcinfo # update package metadata for AUR
makepkg # test package builds
git add PKGBUILD .SRCINFO
git commit -m 'Update to dokku 0.9.9'
git push
```
> If there is something unclear simply ask @morrisjobke for help.

View File

@@ -14,7 +14,7 @@ Example apps can be found here:
### Executing tests locally
- Setup dokku in a [vagrant vm](http://dokku.viewdocs.io/dokku/getting-started/install/vagrant)
- Setup dokku in a [vagrant vm](/dokku/getting-started/install/vagrant)
- Test setup and execution
```shell

View File

@@ -2,27 +2,30 @@
> Note: This is a work in progress.
### DNS Versions
## DNS Versions
There are many different DNS servers 'in the wild'. Some of the popular ones on Linux are BIND, dnsmasq, and pdns. Windows has its own built-in DNS server as well as Unbound, Posadis, and more. A full list of DNS packages can be found on Wikipedia under [Comparison of DNS Server Software](http://en.wikipedia.org/wiki/Comparison_of_DNS_server_software). In addition to the various DNS packages, there are tens of thousands of [Managed DNS Providers](http://en.wikipedia.org/wiki/List_of_managed_DNS_providers) out that all have different DNS interfaces.
### Focus
## Focus
Because there are so many different DNS server packages out there as well as a tremendous number of Managed DNS Providers, we will focus on the concepts of DNS as well as providing examples in the 'BIND' format so you can adapt the information to your own server package or managed DNS provider.
### Assumptions
## Assumptions
* We assume you have a passing familiarity with DNS. If not, you can read an [in-depth article](http://www.diaryofaninja.com/blog/2012/03/03/devops-dns-for-developers-ndash-now-therersquos-no-excuse-not-to-know) on DNS. But basically you need to know that DNS changes names (like example.tld) into addresses (like 127.0.0.1)
* We assume you already have a domain name registered and pointed to your favorite Managed DNS Provider or have your own BIND DNS server running.
* You have a server on the internet and are about to follow the instructions in the [README](https://github.com/dokku/dokku/blob/master/README.md) to get dokku installed. Don't do the install just yet though.
## Caching
### HELP!
Please remember that DNS relies heavily on _caching_. Changes you make to DNS could take anywhere from a few seconds to a few *days* to propagate. If you tried surfing to example.tld, then changed the IP address in DNS, it could be a while before your computer picks up on the changes.
## HELP!
Don't be afraid to ask if you need help. Create a [new issue](https://github.com/dokku/dokku/issues) and someone will be glad to assist you.
# Getting started
## Getting started
For the examples, we will use the domain name `example.tld` and the IP address `127.0.0.1`.
@@ -30,17 +33,11 @@ Dokku uses DNS to differentiate between apps on your dokku-powered server. If y
To get started, you need to know the IP address of your dokku server. Connect to it and run `ifconfig` or `ip addr` to see the IP address.
# Caching
Please remember that DNS relies heavily on _caching_. Changes you make to DNS could take anywhere from a few seconds to a few *days* to propagate. If you tried surfing to example.tld, then changed the IP address in DNS, it could be a while before your computer picks up on the changes.
## The two methods
Now you have to make a decision about your domain. Do you want everything and anything at `example.tld` to go to your dokku server, or would you rather use a 'sub domain' for your dokku server?
In other words, do you want your applications on your dokku server accessible via `myapp.example.tld` or via `myapp.myserver.example.tld`?
### Using a sub-domain (myapp.myserver.example.tld)
#### Using a sub-domain (myapp.myserver.example.tld)
Using a sub-domain is easy. When you set up your server, you probably gave it a name like `myserver.example.tld`.
@@ -75,7 +72,7 @@ If they all return your IP address, you have set DNS up properly for dokku. You
Proceed with the setup instructions in the [README](https://github.com/dokku/dokku/blob/master/README.md)
### Using the root of your domain (myapp.example.tld)
#### Using the root of your domain (myapp.example.tld)
This section is a work in progress. It is incomplete.

View File

@@ -2,15 +2,20 @@
> New as of 0.3.17
Pass [options](http://docs.docker.io/en/latest/reference/run/) to Docker during Dokku's `build`, `deploy` and `run` phases
Pass [options](https://docs.docker.com/engine/reference/run/) to Docker during Dokku's `build`, `deploy` and `run` phases
```
docker-options <app> Display app's Docker options for all phases
docker-options <app> <phase(s)> Display app's Docker options for phase (comma-separated phase list)
docker-options <app> [phase(s)] Display app's Docker options for all phases (or comma separated phase list)
docker-options:add <app> <phase(s)> OPTION Add Docker option to app for phase (comma-separated phase list)
docker-options:remove <app> <phase(s)> OPTION Remove Docker option from app for phase (comma-separated phase list)
```
> When specifying multiple phases, they **must** be comma-separated _without_ spaces in between each phase, like so:
>
> ```
> dokku docker-options:add myapp deploy,run "-v /home/dokku/logs/myapp:/app/logs"
> ```
## About Dokku phases
Dokku deploys your application in multiple "phases" and the `docker-options` plugin allows you to pass arguments to their underlying docker container:

View File

@@ -44,7 +44,6 @@ Jul 3 16:30:02 dokku.me dokku[131384]: INVOKED: docker-args-run( rubyapp )
You can list all events that are currently being recorded via `dokku events:list`:
```
=====> Events currently logged
backup-check
docker-args-build
pre-delete
post-deploy
@@ -56,8 +55,6 @@ post-build-buildpack
post-domains-update
post-release-dockerfile
check-deploy
backup-import
backup-export
git-pre-pull
git-post-pull
nginx-hostname

55
docs/dokku-storage.md Normal file
View File

@@ -0,0 +1,55 @@
# Dokku Core Storage Plugin
> New as of 0.5.0
The preferred method to mount external containers to a dokku managed container, is to use the dokku storage plugin.
```shell
storage:list <app>, List bind mounts for app's container(s) (host:container)
storage:mount <app> <host-dir:container-dir>, Create a new bind mount
storage:unmount <app> <host-dir:container-dir>, Remove an existing bind mount
```
## Ideology and Background
The storage plugin requires explicit paths on the host side. This is intentional to ensure that new users avoid running into unexpected results with implicit paths that may not exist (a feature deprecate in [Docker 1.9.0](https://github.com/docker/docker/releases/tag/v1.9.0])). The container directory is created for the mount point in the container. Any existing directory contents are not accessible after a mount is added to the container. Dokku creates a new directory `/var/lib/dokku/data/storage` during installation, it's the general consensus that new users should use this directory. Mounts are only available at run and deploy times, you must redeploy (restart) an app to mount or unmount to an existing app's container.
## Usage
This example demonstrates how to mount the recommended directory to `/storage` inside the container:
```
$ dokku storage:mount app-name /var/lib/dokku/data/storage:/storage
```
Dokku will then mount the shared contents of`/var/lib/dokku/data/storage` to `/storage` inside the container.
## Use Cases
### Persistent storage
Dokku is powered by Docker containers, which recommends in their [best practices](https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#containers-should-be-ephemeral) that containers be treated as ephemeral. In order to manage persistent storage for web applications, like user uploads or large binary assets like images, a directory outside the container should be mounted.
### Shared storage between containers
When scaling your app, you may require a common location to access shared assets between containers, a storage mount can be used in this situation.
### Shared storage across environments
Your app may be used in a cluster that requires containers or resources not running on the same host access your data. Mounting a shared file service (like S3FS or EFS) inside your container will give you great flexibility.
### Backing up
Your app may have services that are running in memory and need to be backed up locally (like a key store). Mount a non ephemeral storage mount will allow backups that are not lost when the app is shut down.
### Build phase
By default, dokku will only bind storage mounts during the deploy and run phases. Under certain conditions, one might want to bind a storage mount during the build phase. This can be accomplished by using the `docker-options` plugin directly.
```
$ dokku docker-options:add <app> "-v /tmp/python-test:/opt/test"
```
NOTE: **This can cause data loss** if you bind a mount under `/app` in buildpack apps as herokuish will attempt to remove the original app path during the build phase.
## Docker-Options Note
The storage plugins is compatible with storage mounts created with the docker-options. The storage plugin will only list mounts from the deploy phase.

View File

@@ -2,7 +2,7 @@
- If you don't already have one [generate an SSH key pair](https://help.github.com/articles/generating-ssh-keys/).
- Go to the [dokku on azure deployment page](https://azure.microsoft.com/en-us/documentation/templates/dokku-vm/) and click **Deploy to Azure**.
- Go to the [dokku on azure deployment page](https://github.com/azure/azure-quickstart-templates/tree/master/dokku-vm) and click **Deploy to Azure**.
- You'll be prompted to enter a few parameters, including a unique storage account name and a unique name for the sub-domain used for your public IP address. For the `sshKeyData` parameter, copy and paste the contents of the **public** key file you just created. After a few minutes the Dokku instance will be deployed.

View File

@@ -25,7 +25,7 @@ In case you want to perform an unattended installation of dokku, this is made po
You can set any of the below options through the `debconf-set-selections` command, for example to enable vhost-based deployments:
```bash
sudo echo "dokku dokku/vhost_enable boolean true" | debconf-set-selections
echo "dokku dokku/vhost_enable boolean true" | sudo debconf-set-selections
```
After setting the desired options, proceed with the installation as described above.
@@ -37,4 +37,5 @@ After setting the desired options, proceed with the installation as described ab
| dokku/web_config | boolean | true | Use web-based config for below options |
| dokku/vhost_enable | boolean | false | Use vhost-based deployments (e.g. <app>.dokku.me) |
| dokku/hostname | string | dokku.me | Hostname, used as vhost domain and for showing app URL after deploy |
| dokku/skip_key_file| boolean | false | Don't check for the existence of the dokku/key_file. Warning: This setting this to true, will require you to manually add an SSH key later on. |
| dokku/key_file | string | /root/.ssh/id_rsa.pub | SSH key to add to the Dokku user (Will be ignored on `dpkg-reconfigure`) |

View File

@@ -36,4 +36,4 @@ __Warning__: These steps will delete *everything* on your Linode.
9. Lastly, reboot the Linode.
Once your server comes back online, you'll be running Ubuntu's default kernel. You can now follow Dokku's [normal installation instructions](http://dokku.viewdocs.io/dokku/installation) and `bootstrap.sh` will take care of everything else.
Once your server comes back online, you'll be running Ubuntu's default kernel. You can now follow Dokku's [normal installation instructions](/dokku/installation) and `bootstrap.sh` will take care of everything else.

View File

@@ -8,12 +8,6 @@
git clone https://github.com/dokku/dokku.git
```
- Setup SSH hosts in your `/etc/hosts`
```
10.0.0.2 dokku.me
```
- Create VM
```
# Optional ENV arguments:
@@ -35,6 +29,7 @@
- Copy your SSH key via `cat ~/.ssh/id_rsa.pub | pbcopy` and paste it into the dokku-installer at http://dokku.me . Change the `Hostname` field on the Dokku Setup screen to your domain and then check the box that says `Use virtualhost naming`. Then click *Finish Setup* to install your key. You'll be directed to application deployment instructions from here.
Please note, the `dokku.me` domain is setup to point to `10.0.0.2` along with all subdomains (ie yourapp.dokku.me). If you change the `DOKKU_IP` in your vagrant setup you'll need to update your `/etc/hosts` file to point your reconfigured ip address.
You are now ready to deploy an app or install plugins.
For a different, complete, example see https://github.com/RyanBalfanz/dokku-vagrant-example.

View File

@@ -4,19 +4,16 @@ If you’re stuck, there are a number of places you can get help:
## The Official Dokku Website
[http://dokku.viewdocs.io/dokku](http://dokku.viewdocs.io/dokku)
[http://dokku.viewdocs.io/dokku](/dokku)
The Official Dokku website is always a great place to visit. It features links to oft-used developer tools, community plugins, and guides on using dokku.
## The IRC Channel
## The IRC and Slack Channels
IRC Channel on irc.freenode.net:
- [irc.freenode.net/#dokku](https://webchat.freenode.net/?channels=dokku)
- [Gliderlabs Slack](https://glider-slackin.herokuapp.com/)
- #dokku – General Discussion
If you’re stumped, give us a holler in the Dokku IRC channel. Someone from the development team is usually there, especially during the daylight hours for North and South America users. We’d love to hear from you, whether you need some help, want to find users in your area, or would like to donate your brand new sports car.
If [here](http://webchat.freenode.net/?channels=dokku) for a web-based client IRC client.
If you’re stumped, give us a holler in the Dokku IRC or Slack channels. Someone from the development team is usually there, especially during the daylight hours for North and South America users. We’d love to hear from you, whether you need some help, want to find users in your area, or would like to donate your brand new sports car.
## Stack Overflow

View File

@@ -10,72 +10,72 @@
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
<title>Dokku - The smallest PaaS implementation you've ever seen</title>
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/manifest.json">
<link rel="shortcut icon" href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/favicon.ico">
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/manifest.json">
<link rel="shortcut icon" href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/favicon.ico">
<meta name="apple-mobile-web-app-title" content="Dokku">
<meta name="application-name" content="Dokku">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-TileImage" content="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/browserconfig.xml">
<meta name="msapplication-TileImage" content="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
<style type="text/css">
body{padding-bottom:40px;color:#5a5a5a}
h1{color:#5a5a5a;font-family:'montserrat',Optima,Segoe,"Segoe UI",Candara,Calibri,Arial,sans-serif;font-weight:700;line-height:1.1;margin-bottom:12px;margin-top:12px;text-rendering:optimizelegibility}
.header{background-color:#2a8fbd;padding:22px 0}
.header .heading{color:#fff;font-size:23px;margin:0;padding:0}
.blurb{color:#424242;background-color:#ededed;background-image:url(./assets/gplaypattern.png);padding:45px 0;text-align:center}
.blurb p{font-size:17px;font-weight:300;margin:18px 0;text-align:center}
.quickstart-code{display:block;font-size:12px;line-height:1.3em;margin:45px auto;max-width:750px;padding:0}
.quickstart-code .title{background-color:#dfdfdf;background-image:linear-gradient(top,#f7f7f7 0%,#dfdfdf 7%,#ccc 100%);border-bottom:1px solid #111;color:#444;display:block;font-weight:400;font-size:14px;margin:0 20px;padding:3px 0;text-align:center;text-shadow:0 1px 0 rgba(255,255,255,0.5);border-radius:5px 5px 0 0;box-shadow:0 3px 0 rgba(0,0,0,0.5)}
.quickstart-code .shell{background-color:#171717;font-family:Menlo,Consolas,"Courier New",Courier,"Liberation Mono",monospace;margin:0 20px;padding:20px;text-shadow:none;border-radius:0 0 5px 5px;box-shadow:0 5px 30px rgba(0,0,0,0.3)}
.quickstart-code .line{display:block;margin:0;padding:0}
.quickstart-code .line span{display:inline-block}
.quickstart-code .line .output{color:#aaaaaa;}
.quickstart-code .path{color:#2a8fbd;user-select:none}
.quickstart-code .prompt{color:#f90;user-select:none}
.quickstart-code .command{color:#ffc}
.marketing .col-lg-4{margin-bottom:20px;text-align:center}
.marketing .col-lg-4 p{margin-right:10px;margin-left:10px}
.featurette-divider{margin:20px 0}
.featurette-heading{font-weight:400;line-height:1;letter-spacing:-1px}
.featurette-heading .text-muted{font-weight:300}
@media (min-width: 768px) {
.quickstart-code{font-size:14px;line-height:22px}
.featurette-heading{font-size:50px}
}
@media (min-width: 992px) {
.featurette-heading{margin-top:120px}
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/style.css" rel="stylesheet">
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
<style>
</style>
</head>
<body>
<div class="header">
<div class="container">
<h1 class="heading">Dokku</h1>
<div class="row">
<div>
<h1 class="heading navbar-brand">
<a href="http://dokku.viewdocs.io/dokku/">Dokku</a>
</h1>
<ul class="nav nav-pills pull-xs-right">
<li class="nav-item">
<a class="nav-link" href="https://dokku.github.io/">Blog</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://github.com/dokku/dokku/">Code</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/{{NAME}}/installation/">Docs</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://webchat.freenode.net/?channels=dokku">IRC</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://glider-slackin.herokuapp.com/">Slack</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="blurb">
<div class="container">
<h2>The smallest PaaS implementation you've ever seen</h2>
<p>Docker powered mini-Heroku in around 200 lines of Bash</p>
<div class="blurb-buttons">
<a class="btn btn-lg btn-warning" href="/dokku/installation">View Documentation</a>
<div class="row">
<h2>The smallest PaaS implementation you've ever seen</h2>
<p>Docker powered mini-Heroku in around 200 lines of Bash</p>
<div class="blurb-buttons">
<a class="btn btn-lg btn-warning" href="/dokku/installation/">View Documentation</a>
</div>
</div>
</div>
</div>
@@ -83,25 +83,109 @@
<div class="container marketing">
<div class="quickstart-code">
<p class="title">Quick-start Instructions</p>
<div class="shell">
<div class="tabs">
<div data-tab="curl" class="tab tab-curl tab-active">curl | bash</div>
<div data-tab="apt" class="tab tab-apt">apt</div>
<div data-tab="arch" class="tab tab-arch">arch</div>
</div>
<div class="shell shell-curl shell-active">
<p class="line">
<span class="path">~</span>
<span class="prompt">$</span>
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.4.10/bootstrap.sh</span>
<span class="output">&nbsp;# for debian systems, installs dokku via apt-get</span>
</p>
<p class="line">
<span class="path">~</span>
<span class="path"></span>
<span class="prompt">$</span>
<span class="command">sudo DOKKU_TAG=v0.4.10 bash bootstrap.sh</span>
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.6.2/bootstrap.sh</span>
</p>
<p class="line">
<span class="output"># =&gt; Go to your server's IP and follow the web installer</span>
<span class="path"></span>
<span class="prompt">$</span>
<span class="command">sudo DOKKU_TAG=v0.6.2 bash bootstrap.sh</span>
</p>
<p class="line">
<span class="output">&nbsp;# go to your server's IP and follow the web installer</span>
</p>
</div>
<div class="shell shell-apt">
<p class="line">
<span class="output">&nbsp;# install docker</span>
</p>
<p class="line">
<span class="path"></span>
<span class="prompt">$</span>
<span class="command">wget -nv -O - https://get.docker.com/ | sh</span>
</p>
<p class="line">
<span class="output">&nbsp;# setup dokku apt repository</span>
</p>
<p class="line">
<span class="path"></span>
<span class="prompt">$</span>
<span class="command">wget -nv -O - https://packagecloud.io/gpg.key | apt-key add -</span>
</p>
<p class="line">
<span class="path"></span>
<span class="prompt">$</span>
<span class="command">export SOURCE="https://packagecloud.io/dokku/dokku/ubuntu/"</span>
</p>
<p class="line">
<span class="path"></span>
<span class="prompt">$</span>
<span class="command">echo "deb $SOURCE trusty main" | tee /etc/apt/sources.list.d/dokku.list</span>
</p>
<p class="line">
<span class="path"></span>
<span class="prompt">$</span>
<span class="command">apt-get update</span>
</p>
<p class="line">
<span class="output">&nbsp;# install dokku</span>
</p>
<p class="line">
<span class="path"></span>
<span class="prompt">$</span>
<span class="command">apt-get install dokku</span>
</p>
<p class="line">
<span class="path"></span>
<span class="prompt">$</span>
<span class="command">dokku plugin:install-dependencies --core <span class="output"># run with root!</span></span>
</p>
<p class="line">
<span class="output">&nbsp;# go to your server's IP and follow the web installer</span>
</p>
</div>
<div class="shell shell-arch">
<p class="line">
<span class="output">&nbsp;# install dokku via yaourt</span>
</p>
<p class="line">
<span class="path"></span>
<span class="prompt">$</span>
<span class="command">yaourt -S dokku</span>
</p>
</div>
</div>
<hr class="featurette-divider">
<div class="alternate-instructions">
<p>Hate <code>curl | bash</code>? See our official <a href="https://github.com/Azure/azure-quickstart-templates/tree/master/dokku-vm" target="_blank">Azure</a>, <a href="https://www.digitalocean.com/features/one-click-apps/dokku/" target="_blank">DigitalOcean</a>, and <a href="/{{NAME}}~{{REF}}/getting-started/install/linode/" target="_blank">Linode</a> instructions.<p>
<p>Still no love? <a href="https://github.com/dokku/dokku/blob/master/CONTRIBUTING.md" target="_blank">Contributions welcome</a>!</a>
</div>
</div>
<div class="container-fluid slack-channel">
Have a question? Join us in our public slack channel!
<div class="inline-container">
<a class="button slack-button" href="https://glider-slackin.herokuapp.com/">
<img src="./assets/slack-logo.png" alt="Slack Logo">
</a>
</div>
</div>
<div class="container marketing">
<!-- START THE FEATURETTES -->
<div class="row featurette">
@@ -137,15 +221,121 @@
<img class="featurette-image img-responsive center-block" alt="Extend Logo" src="./assets/extend.png">
</div>
</div>
</div>
<hr class="featurette-divider">
<div class="container-fluid slack-channel team-members">
<h3>Meet the core team</h3>
<div class="row">
<div class="team-member col-md-offset-0 col-md-4 col-sm-offset-2 col-sm-4 col-xs-offset-3 col-xs-6">
<div class="team-member-image">
<img src="./assets/team/progrium-hidden.jpg" alt="Jeff Lindsay">
<img src="./assets/team/progrium.jpg" alt="Jeff Lindsay">
</div>
Jeff Lindsay
<a class="fund-link" href="https://www.patreon.com/progrium">Sponsor people they sponsor</a>
</div>
<div class="team-member col-md-offset-0 col-md-4 col-sm-offset-0 col-sm-4 col-xs-offset-3 col-xs-6">
<div class="team-member-image">
<img src="./assets/team/josegonzalez-hidden.jpg" alt="Morris Jobke">
<img src="./assets/team/josegonzalez.jpg" alt="Morris Jobke">
</div>
Jose Diaz-Gonzalez
<a class="fund-link" href="http://www.amazon.com/registry/wishlist/36RYHSXCFYDTG/">Buy him something nice</a>
</div>
<div class="team-member col-md-offset-0 col-md-4 col-sm-offset-2 col-sm-4 col-xs-offset-3 col-xs-6">
<div class="team-member-image">
<img src="./assets/team/u2mejc-hidden.jpg" alt="Justin Clark">
<img src="./assets/team/u2mejc.jpg" alt="Justin Clark">
</div>
Justin Clark
<a class="fund-link" href="http://smile.amazon.com/registry/wishlist/3SCPXMNI2EIYV">Feed his dog greenie treats!</a>
</div>
<div class="team-member col-md-offset-0 col-md-4 col-sm-offset-0 col-sm-4 col-xs-offset-3 col-xs-6">
<div class="team-member-image">
<img src="./assets/team/flink-hidden.jpg" alt="Loïc Guitaut">
<img src="./assets/team/flink.jpg" alt="Loïc Guitaut">
</div>
Loïc Guitaut
<a class="fund-link" href="https://www.amazon.com/gp/registry/wishlist/23NWY5AVAGGGO/">Build out his star wars collection</a>
</div>
<div class="team-member col-md-offset-0 col-md-4 col-sm-offset-2 col-sm-4 col-xs-offset-3 col-xs-6">
<div class="team-member-image">
<img src="./assets/team/michaelshobbs-hidden.jpg" alt="Michael Hobbs">
<img src="./assets/team/michaelshobbs.jpg" alt="Michael Hobbs">
</div>
Michael Hobbs
<a class="fund-link" href="https://gratipay.com/~michaelshobbs/">Fund on gratipay</a>
</div>
<div class="team-member col-md-offset-0 col-md-4 col-sm-offset-0 col-sm-4 col-xs-offset-3 col-xs-6">
<div class="team-member-image">
<img src="./assets/team/morrisjobke-hidden.jpg" alt="Morris Jobke">
<img src="./assets/team/morrisjobke.jpg" alt="Morris Jobke">
</div>
Morris Jobke
<a class="fund-link" href="">Get him an ebook</a>
</div>
</div>
</div>
<div class="container">
<footer>
<p class="pull-right"><a href="#">Back to top</a></p>
<p>&copy; 2013 Dokku</p>
<p>&copy; 2013-2016 Dokku</p>
</footer>
</div>
<script>
document.addEventListener('DOMContentLoaded', function (e) {
var addClass = function (el, className) {
if (el.classList) {
el.classList.add(className);
} else {
el.className += ' ' + className;
}
},
addListener = function (elem, type, fn) {
if (elem.addEventListener) {
elem.addEventListener(type, fn, false);
} else if (elem.attachEvent) {
elem.attachEvent("on" + type, function() {
return fn.call(elem, window.event);
});
} else {
elem["on" + type] = fn;
}
},
hasClass = function(el, className) {
if (el.classList) {
return el.classList.contains(className);
} else {
return new RegExp('(^| )' + className + '( |$)', 'gi').test(el.className);
}
},
removeClass = function(el, className) {
if (el.classList) {
el.classList.remove(className);
} else {
el.className = el.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), ' ');;
}
},
activateTab = function(tab) {
removeClass(document.querySelectorAll('.shell-active')[0], 'shell-active');
removeClass(document.querySelectorAll('.tab-active')[0], 'tab-active');
addClass(document.querySelectorAll('.shell-' + tab)[0], 'shell-active');
addClass(document.querySelectorAll('.tab-' + tab)[0], 'tab-active');
window.location.hash = '#install-' + tab;
};
var hash = window.location.hash.replace('#install-', '');
if (['curl', 'apt', 'arch'].indexOf(hash) !== -1) {
activateTab(hash);
}
Array.prototype.forEach.call(document.querySelectorAll('.tab'), function (el, i) {
addListener(el, 'click', function(e) {
activateTab(this.getAttribute('data-tab'));
});
});
});
</script>
</body>
</html>

View File

@@ -1,70 +0,0 @@
<div class="blurb">
<div class="container">
<h2>The smallest PaaS implementation you've ever seen</h2>
<p>Docker powered mini-Heroku in around 200 lines of Bash</p>
<div class="blurb-buttons">
<a class="btn btn-lg btn-warning" href="/dokku/installation">View Documentation</a>
</div>
</div>
</div>
<div class="container marketing">
<div class="quickstart-code">
<p class="title">Quick-start Instructions</p>
<div class="shell">
<p class="line">
<span class="path">~</span>
<span class="prompt">$</span>
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.4.10/bootstrap.sh</span>
</p>
<p class="line">
<span class="path">~</span>
<span class="prompt">$</span>
<span class="command">sudo DOKKU_TAG=v0.4.10 bash bootstrap.sh</span>
</p>
<p class="line">
<span class="output"># =&gt; Go to your server's IP and follow the web installer</span>
</p>
</div>
</div>
<hr class="featurette-divider">
<!-- START THE FEATURETTES -->
<div class="row featurette">
<div class="col-md-7">
<h2 class="featurette-heading">Own Your PaaS. <span class="text-muted">Infrastructure at a fraction of the cost.</span></h2>
<p class="lead">Powered by Docker, you can install Dokku on any hardware. Use it on inexpensive cloud providers. Use the extra cash to buy a pony or feed kittens. You'll save tens of dollars a year on your dog photo sharing website.</p>
</div>
<div class="col-md-5">
<img class="featurette-image img-responsive center-block" alt="Docker Logo" src="assets/docker.png">
</div>
</div>
<hr class="featurette-divider">
<div class="row featurette">
<div class="col-md-7 col-md-push-5">
<h2 class="featurette-heading">Easy Git Deploys. <span class="text-muted">From your command-line to the cloud.</span></h2>
<p class="lead">Once it's set up on a host, you can push Heroku-compatible applications to it via Git. They'll build using Heroku buildpacks and then run in isolated containers. The end result is your own, single-host version of Heroku.</p>
</div>
<div class="col-md-5 col-md-pull-7">
<img class="featurette-image img-responsive center-block" alt="Git Logo" src="assets/git.png">
</div>
</div>
<hr class="featurette-divider">
<div class="row featurette">
<div class="col-md-7">
<h2 class="featurette-heading">Extensible Platform. <span class="text-muted">Customize your PaaS.</span></h2>
<p class="lead">Write dokku plugins in any language. Share them online with others, and extend those already available. Dokku's simple core is easy to hack and add the features you need to get your job done.</p>
</div>
<div class="col-md-5">
<img class="featurette-image img-responsive center-block" alt="Extend Logo" src="assets/extend.png">
</div>
</div>
<hr class="featurette-divider">
</div>

View File

@@ -4,7 +4,7 @@
Dokku is an extensible, open source Platform as a Service that runs on a single server of your choice.
To start using Dokku, you'll need a system with that meets the following minimum requirements:
To start using Dokku, you'll need a system that meets the following minimum requirements:
- A fresh installation of [Ubuntu 14.04 x64](http://www.ubuntu.com/download/) with the FQDN set <sup>[1]</sup>
- At least `1GB` of system memory <sup>[2]</sup>
@@ -15,35 +15,42 @@ Dokku is designed for usage on a fresh installation of Ubuntu, and should instal
### Installing the latest stable version
#### 1. Install dokku
To install the latest stable version of dokku, you can run the following shell commands:
```shell
# installs dokku via apt-get
wget https://raw.githubusercontent.com/dokku/dokku/v0.4.10/bootstrap.sh
sudo DOKKU_TAG=v0.4.10 bash bootstrap.sh
# for debian systems, installs dokku via apt-get
wget https://raw.githubusercontent.com/dokku/dokku/v0.6.2/bootstrap.sh
sudo DOKKU_TAG=v0.6.2 bash bootstrap.sh
```
The installation process takes about 5-10 minutes, depending upon internet connection speed.
#### 2. Setup SSH key and Virtualhost Settings
Once the installation is complete, you can open a browser to setup your SSH key and virtualhost settings. Open your browser of choice and navigate to the host's IP address - or the domain you assigned to that IP previously - and configure dokku via the web admin.
*If you don't complete setup via the web installer (even if you set up SSH keys and virtual hosts otherwise) your dokku installation will remain vulnerable to anyone finding the setup page and inserting their key.*
#### 3. Deploy your first application
Once you save your settings, the web admin will self-terminate and you should be able to run or deploy to the dokku installation.
### Installing via other methods
For various reasons, certain hosting providers may have other steps that should be preferred to the above. If hosted on any of the following popular hosts, please follow the linked to instructions:
- [Digital Ocean Installation Notes](http://dokku.viewdocs.io/dokku/getting-started/install/digitalocean)
- [Linode Installation Notes](http://dokku.viewdocs.io/dokku/getting-started/install/linode/)
- [Microsoft Azure Installation Notes](http://dokku.viewdocs.io/dokku/getting-started/install/azure/)
- [Digital Ocean Installation Notes](/dokku/getting-started/install/digitalocean)
- [Linode Installation Notes](/dokku/getting-started/install/linode/)
- [Microsoft Azure Installation Notes](/dokku/getting-started/install/azure/)
As well, you may wish to customize your installation in some other fashion. or experiment with vagrant. The guides below should get you started:
- [Debian Package Installation Notes](http://dokku.viewdocs.io/dokku/getting-started/install/debian)
- [Vagrant Installation Notes](http://dokku.viewdocs.io/dokku/getting-started/install/vagrant)
- [Advanced Install Customization](http://dokku.viewdocs.io/dokku/advanced-installation)
- [Debian Package Installation Notes](/dokku/getting-started/install/debian)
- [Vagrant Installation Notes](/dokku/getting-started/install/vagrant)
- [Advanced Install Customization](/dokku/advanced-installation)
---
- <sup>[1]: To check whether your system has an fqdn set, run `sudo hostname -f`</sup>
- <sup>[2]: If your system has less than 1GB of memory, you can use ([this workaround](http://dokku.viewdocs.io/dokku/advanced-installation)).</sup>
- <sup>[2]: If your system has less than 1GB of memory, you can use [this workaround](/dokku/advanced-installation/#vms-with-less-than-1gb-of-memory).</sup>

View File

@@ -3,70 +3,186 @@
Dokku uses nginx as its server for routing requests to specific applications. By default, access and error logs are written for each app to `/var/log/nginx/${APP}-access.log` and `/var/log/nginx/${APP}-error.log` respectively
```
nginx:access-logs <app> [-t] Show the nginx access logs for an application (-t follows)
nginx:build-config <app> (Re)builds nginx config for given app
nginx:disable <app> Disable nginx for an application (forces container binding to external interface)
nginx:enable <app> Enable nginx for an application
nginx:error-logs <app> [-t] Show the nginx error logs for an application (-t follows)
nginx:access-logs <app> [-t] Show the nginx access logs for an application (-t follows)
nginx:build-config <app> (Re)builds nginx config for given app
nginx:error-logs <app> [-t] Show the nginx error logs for an application (-t follows)
```
## Customizing the nginx configuration
> New as of 0.3.10.
> New as of 0.5.0
Dokku currently templates out an nginx configuration that is included in the `nginx-vhosts` plugin. If you'd like to provide a custom template for your application, there are a few options:
Dokku uses a templating library by the name of [sigil](https://github.com/gliderlabs/sigil) to generate nginx configuration for each app. If you'd like to provide a custom template for your application, there are a couple options:
- Copy the existing pertinent (ssl or non-ssl) template found (by default) in `/var/lib/dokku/plugins/available/nginx-vhosts/templates`, place it either in `/home/dokku/APP` or check it into the root of your app repo, and name it one of the following:
- `nginx.conf.template` (since 0.3.10)
- `nginx.conf.ssl_terminated.template` (since 0.4.0)
- `nginx.ssl.conf.template` (since 0.4.2)
- Copy the following example template to a file named `nginx.conf.sigil` and either:
- check it into the root of your app repo
- `ADD` it to your dockerfile `WORKDIR`
- if your dockerfile has no `WORKDIR`, `ADD` it to the `/app` folder
> If placed on the dokku server, the template file **must** be owned by user and group `dokku:dokku`.
> When using a custom `nginx.conf.sigil` file, depending upon your application configuration, you *may* be exposing the file externally. As this file is extracted before the container is run, you can, safely delete it in a custom `entrypoint.sh` configured in a Dockerfile `ENTRYPOINT`.
For instance - assuming defaults - to customize the nginx template in use for the `myapp` application, create the file `nginx.conf.template` in your repo or on disk with the with the following contents:
### Example Custom Template
Use case: add an `X-Served-By` header to requests
```
server {
listen [::]:80;
listen 80;
server_name $NOSSL_SERVER_NAME;
access_log /var/log/nginx/${APP}-access.log;
error_log /var/log/nginx/${APP}-error.log;
listen [::]:{{ .NGINX_PORT }};
listen {{ .NGINX_PORT }};
server_name {{ .NOSSL_SERVER_NAME }};
access_log /var/log/nginx/{{ .APP }}-access.log;
error_log /var/log/nginx/{{ .APP }}-error.log;
# set a custom header for requests
add_header X-Served-By www-ec2-01;
gzip on;
gzip_min_length 1100;
gzip_buffers 4 32k;
gzip_types text/css text/javascript text/xml text/plain text/x-component application/javascript application/x-javascript application/json application/xml application/rss+xml font/truetype application/x-font-ttf font/opentype application/vnd.ms-fontobject image/svg+xml;
gzip_vary on;
gzip_comp_level 6;
location / {
proxy_pass http://$APP;
proxy_pass http://{{ .APP }};
proxy_http_version 1.1;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host \$http_host;
proxy_set_header X-Forwarded-Proto \$scheme;
proxy_set_header X-Forwarded-For \$remote_addr;
proxy_set_header X-Forwarded-Port \$server_port;
proxy_set_header X-Request-Start \$msec;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Request-Start $msec;
}
include $DOKKU_ROOT/$APP/nginx.conf.d/*.conf;
include {{ .DOKKU_ROOT }}/{{ .APP }}/nginx.conf.d/*.conf;
}
upstream {{ .APP }} {
{{ range .DOKKU_APP_LISTENERS | split " " }}
server {{ . }};
{{ end }}
}
```
The above is a sample http configuration that adds an `X-Served-By` header to requests.
### Available template variables
```
{{ .APP }} Application name
{{ .APP_SSL_PATH }} Path to SSL certificate and key
{{ .DOKKU_ROOT }} Global dokku root directory (ex: app dir would be `{{ .DOKKU_ROOT }}/{{ .APP }}`)
{{ .DOKKU_APP_LISTENERS }} List of IP:PORT pairs of app containers
{{ .NGINX_PORT }} Non-SSL nginx listener port (same as `DOKKU_NGINX_PORT` config var)
{{ .NGINX_SSL_PORT }} SSL nginx listener port (same as `DOKKU_NGINX_SSL_PORT` config var)
{{ .NOSSL_SERVER_NAME }} List of non-SSL VHOSTS
{{ .PROXY_PORT_MAP }} List of port mappings (same as `DOKKU_PROXY_PORT_MAP` config var)
{{ .PROXY_UPSTREAM_PORTS }} List of configured upstream ports (derived from `DOKKU_PROXY_PORT_MAP` config var)
{{ .RAW_TCP_PORTS }} List of exposed tcp ports as defined by Dockerfile `EXPOSE` directive (**Dockerfile apps only**)
{{ .SSL_INUSE }} Boolean set when an app is SSL-enabled
{{ .SSL_SERVER_NAME }} List of SSL VHOSTS
```
A few tips for custom nginx templates:
> NOTE: Application config variables are available for use in custom templates. To do so, use the form of `{{ var "FOO" }}` to access a variable named `FOO`.
- Special characters - dollar signs, spaces inside of quotes, etc. - should be escaped with a single backslash or can cause deploy failures.
- Templated files will be validated via `nginx -t`.
- Application environment variables can be used within your nginx configuration.
After your changes a `dokku deploy myapp` will regenerate the `/home/dokku/myapp/nginx.conf` file which is then used.
### Example HTTP to HTTPS Custom Template
Use case: a simple dockerfile app that includes `EXPOSE 80`
```
server {
listen [::]:80;
listen 80;
server_name {{ .NOSSL_SERVER_NAME }};
access_log /var/log/nginx/{{ .APP }}-access.log;
error_log /var/log/nginx/{{ .APP }}-error.log;
return 301 https://$host:443$request_uri;
}
server {
listen [::]:443 ssl spdy;
listen 443 ssl spdy;
{{ if .SSL_SERVER_NAME }}server_name {{ .SSL_SERVER_NAME }}; {{ end }}
access_log /var/log/nginx/{{ .APP }}-access.log;
error_log /var/log/nginx/{{ .APP }}-error.log;
ssl_certificate {{ .APP_SSL_PATH }}/server.crt;
ssl_certificate_key {{ .APP_SSL_PATH }}/server.key;
keepalive_timeout 70;
add_header Alternate-Protocol 443:npn-spdy/2;
location / {
proxy_pass http://{{ .APP }};
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Request-Start $msec;
}
include {{ .DOKKU_ROOT }}/{{ .APP }}/nginx.conf.d/*.conf;
}
upstream {{ .APP }} {
{{ range .DOKKU_APP_LISTENERS | split " " }}
server {{ . }};
{{ end }}
}
```
### Example using new proxy port mapping
```
{{ range $port_map := .PROXY_PORT_MAP | split " " }}
{{ $port_map_list := $port_map | split ":" }}
{{ $scheme := index $port_map_list 0 }}
{{ $listen_port := index $port_map_list 1 }}
{{ $upstream_port := index $port_map_list 2 }}
server {
listen [::]:{{ $listen_port }};
listen {{ $listen_port }};
server_name {{ $.NOSSL_SERVER_NAME }};
access_log /var/log/nginx/{{ $.APP }}-access.log;
error_log /var/log/nginx/{{ $.APP }}-error.log;
location / {
gzip on;
gzip_min_length 1100;
gzip_buffers 4 32k;
gzip_types text/css text/javascript text/xml text/plain text/x-component application/javascript application/x-javascript application/json application/xml application/rss+xml font/truetype application/x-font-ttf font/opentype application/vnd.ms-fontobject image/svg+xml;
gzip_vary on;
gzip_comp_level 6;
proxy_pass http://{{ $.APP }}-{{ $upstream_port }};
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Request-Start $msec;
}
include {{ $.DOKKU_ROOT }}/{{ $.APP }}/nginx.conf.d/*.conf;
}
{{ range $upstream_port := $.PROXY_UPSTREAM_PORTS | split " " }}
upstream {{ $.APP }}-{{ $upstream_port }} {
{{ range $listeners := $.DOKKU_APP_LISTENERS | split " " }}
{{ $listener_list := $listeners | split ":" }}
{{ $listener_ip := index $listener_list 0 }}
{{ $listener_port := index $listener_list 1 }}
server {{ $listener_ip }}:{{ $upstream_port }};{{ end }}
}
{{ end }}
```
### Customizing via configuration files included by the default templates
The default nginx.conf- templates will include everything from your apps `nginx.conf.d/` subdirectory in the main `server {}` block (see above):
The default nginx.conf template will include everything from your apps `nginx.conf.d/` subdirectory in the main `server {}` block (see above):
```
include $DOKKU_ROOT/$APP/nginx.conf.d/*.conf;
include {{ .DOKKU_ROOT }}/{{ .APP }}/nginx.conf.d/*.conf;
```
That means you can put additional configuration in separate files, for example to limit the uploaded body size to 50 megabytes, do
@@ -78,123 +194,23 @@ chown dokku:dokku /home/dokku/myapp/nginx.conf.d/upload.conf
service nginx reload
```
The example above uses additional configuration files directly on the dokku host. Unlike the `nginx.conf.sigil` file, these additional files will not be copied over from your application repo, and thus need to be placed in the `/home/dokku/myapp/nginx.conf.d/` directory manually.
## Domains plugin
See the [domain-configuration documentation](/dokku/deployment/domain-configuration/).
## Customizing hostnames
Applications typically have the following structure for their hostname:
See the [customizing hostnames documentation](/dokku/deployment/domain-configuration/#customizing-hostnames).
```
scheme://subdomain.domain.tld
```
## Disabling VHOSTS
The `subdomain` is inferred from the pushed application name, while the `domain` is set during initial configuration in the `$DOKKU_ROOT/VHOST` file.
You can optionally override this in a plugin by implementing the `nginx-hostname` plugin trigger. For example, you can reverse the subdomain with the following sample `nginx-hostname` plugin trigger:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
APP="$1"; SUBDOMAIN="$2"; VHOST="$3"
NEW_SUBDOMAIN=`echo $SUBDOMAIN | rev`
echo "$NEW_SUBDOMAIN.$VHOST"
```
If the `nginx-hostname` has no output, the normal hostname algorithm will be executed.
You can also use the built-in `domains` plugin to handle:
### Disabling VHOSTS
If desired, it is possible to disable vhosts by setting the environment variable `NO_VHOST=1`:
```shell
dokku config:set myapp NO_VHOST=1
```
On subsequent deploys, the nginx virtualhost will be discarded. This is useful when deploying internal-facing services that should not be publicly routeable. As of 0.4.0, nginx will still be configured to proxy your app on some random high port. This allows internal services to maintain the same port between deployments. You may change this port by setting `DOKKU_NGINX_PORT` and/or `DOKKU_NGINX_SSL_PORT` (for services configured to use SSL.)
### Domains plugin
> New as of 0.3.10
```shell
domains:add <app> DOMAIN Add a custom domain to app
domains <app> List custom domains for app
domains:clear <app> Clear all custom domains for app
domains:remove <app> DOMAIN Remove a custom domain from app
```
The domains plugin allows you to specify custom domains for applications. This plugin is aware of any ssl certificates that are imported via `nginx:import-ssl`. Be aware that setting `NO_VHOST` will override any custom domains.
Custom domains are also backed up via the built-in `backup` plugin
```shell
# where `myapp` is the name of your app
# add a domain to an app
dokku domains:add myapp example.com
# list custom domains for app
dokku domains myapp
# clear all custom domains for app
dokku domains:clear myapp
# remove a custom domain from app
dokku domains:remove myapp example.com
```
## Container network interface binding
> New as of 0.3.13
The deployed docker container running your app's web process will bind to either the internal docker network interface (i.e. `docker inspect --format '{{ .NetworkSettings.IPAddress }}' $CONTAINER_ID`) or an external interface (i.e. 0.0.0.0) depending on dokku's VHOST configuration. Dokku will attempt to bind to the internal docker network interface unless you specifically set NO_VHOST for the given app or your dokku installation is not setup to use VHOSTS (i.e. $DOKKU_ROOT/VHOST is missing or $DOKKU_ROOT/HOSTNAME is set to an IPv4 or IPv6 address)
```shell
# container bound to docker interface
root@dokku:~/dokku# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1b88d8aec3d1 dokku/node-js-app:latest "/bin/bash -c '/star About a minute ago Up About a minute goofy_albattani
root@dokku:~/dokku# docker inspect --format '{{ .NetworkSettings.IPAddress }}' goofy_albattani
172.17.0.6
# container bound to all interfaces (previous default)
root@dokku:/home/dokku# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d6499edb0edb dokku/node-js-app:latest "/bin/bash -c '/star About a minute ago Up About a minute 0.0.0.0:49153->5000/tcp nostalgic_tesla
```
See the [disabling vhosts documentation](/dokku/deployment/domain-configuration/#disabling-vhosts).
## Default site
By default, dokku will route any received request with an unknown HOST header value to the lexicographically first site in the nginx config stack. If this is not the desired behavior, you may want to add the following configuration to the global nginx configuration. This will catch all unknown HOST header values and return a `410 Gone` response. You can replace the `return 410;` with `return 444;` which will cause nginx to not respond to requests that do not match known domains (connection refused).
```
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
return 410;
log_not_found off;
}
```
You may also wish to use a separate vhost in your `/etc/nginx/sites-enabled` directory. To do so, create the vhost in that directory as `/etc/nginx/sites-enabled/00-default.conf`. You will also need to change two lines in the main `nginx.conf`:
```
# Swap both conf.d include line and the sites-enabled include line. From:
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
# to the following
include /etc/nginx/sites-enabled/*;
include /etc/nginx/conf.d/*.conf;
```
Alternatively, you may push an app to your dokku host with a name like "00-default". As long as it lists first in `ls /home/dokku/*/nginx.conf | head`, it will be used as the default nginx vhost.
See the [default site documentation](/dokku/deployment/domain-configuration/#default-site).
## Running behind a load balancer
@@ -207,3 +223,7 @@ See the [HSTS documentation](/dokku/deployment/ssl-configuration/#hsts-header).
## SSL Configuration
See the [ssl documentation](/dokku/deployment/ssl-configuration/).
## Disabling Nginx
See the [proxy documentation](/dokku/proxy/).

View File

@@ -26,7 +26,7 @@ dokku plugins-install
## Creating your own plugin
[See the full documentation](http://dokku.viewdocs.io/dokku/development/plugin-creation).
[See the full documentation](/dokku/development/plugin-creation).
## Official Plugins (Beta)
@@ -47,6 +47,7 @@ The following plugins are available and provided by dokku maintainers. Where not
| [RethinkDB (beta)](https://github.com/dokku/dokku-rethinkdb-plugin) | [dokku][] | 0.4.0+ |
| [Copy Files to Image](https://github.com/dokku/dokku-copyfiles-to-image) | [dokku][] | 0.4.0+ |
| [HTTP Auth (beta)](https://github.com/dokku/dokku-http-auth) | [dokku][] | 0.4.0+ |
| [Let's Encrypt (beta)](https://github.com/dokku/dokku-letsencrypt) | [dokku][] | 0.4.0+ |
| [Maintenance mode (beta)](https://github.com/dokku/dokku-maintenance) | [dokku][] | 0.4.0+ |
| [Redirect (beta)](https://github.com/dokku/dokku-redirect) | [dokku][] | 0.4.0+ |
@@ -62,14 +63,17 @@ Note: The following plugins have been supplied by our community and may not have
[alex-sherwin]: https://github.com/alex-sherwin
[alexanderbeletsky]: https://github.com/alexanderbeletsky
[alexkruegger]: https://github.com/alexkruegger
[Aluxian]: https://github.com/Aluxian
[Aomitayo]: https://github.com/Aomitayo
[apmorton]: https://github.com/apmorton
[Benjamin-Dobell]: https://github.com/Benjamin-Dobell
[basgys]: https://github.com/basgys
[blag]: https://github.com/blag
[cameron-martin]: https://github.com/cameron-martin
[cedricziel]: https://github.com/cedricziel
[cef]: https://github.com/cef
[cjblomqvist]: https://github.com/cjblomqvist
[crisward]: https://github.com/crisward
[darkpixel]: https://github.com/darkpixel
[dokku]: https://github.com/dokku
[dyson]: https://github.com/dyson
@@ -80,6 +84,7 @@ Note: The following plugins have been supplied by our community and may not have
[gdi2290]: https://github.com/gdi2290
[heichblatt]: https://github.com/heichblatt
[hughfletcher]: https://github.com/hughfletcher
[iamale]: https://github.com/iamale
[ignlg]: https://github.com/ignlg
[iskandar]: https://github.com/iskandar
[jagandecapri]: https://github.com/jagandecapri
@@ -136,7 +141,8 @@ Note: The following plugins have been supplied by our community and may not have
| Plugin | Author | Compatibility |
| ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- |
| [Redis](https://github.com/sekjun9878/dokku-redis-plugin) | [sekjun9878][] | 0.3.26+ |
| [Nginx Cache](https://github.com/Aluxian/dokku-nginx-cache) | [Aluxian][] | 0.5.0+ |
| [Redis](https://github.com/sekjun9878/dokku-redis-plugin) | [sekjun9878][] | 0.3.26+ |
| [Redis (single container)](https://github.com/ohardy/dokku-redis) | [ohardy][] | 0.3.x |
| [Varnish](https://github.com/Zenedith/dokku-varnish-plugin) | [Zenedith][] | Varnish cache between nginx and application with base configuration|
@@ -146,12 +152,16 @@ Note: The following plugins have been supplied by our community and may not have
| ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- |
| [RabbitMQ](https://github.com/jlachowski/dokku-rabbitmq-plugin) | [jlachowski][] | 0.3.x |
| [RabbitMQ (single container)](https://github.com/jlachowski/dokku-rabbitmq-single-plugin) | [jlachowski][] | 0.3.x |
| [ElasticMQ (SQS compatible)](https://github.com/cu12/dokku-elasticmq) | [cu12][] | 0.5.0+ |
#### Other
| Plugin | Author | Compatibility |
| ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- |
| [RethinkDB](https://github.com/stuartpb/dokku-rethinkdb-plugin) | [stuartpb][] | 0.3.x |
| [etcd](https://github.com/basgys/dokku-etcd) | [basgys][] | 0.4.x |
| [FakeSNS](https://github.com/cu12/dokku-fake_sns) | [cu12][] | 0.5.0+ |
| [InfluxDB](https://github.com/basgys/dokku-influxdb) | [basgys][] | 0.4.x |
| [RethinkDB](https://github.com/stuartpb/dokku-rethinkdb-plugin) | [stuartpb][] | 0.3.x |
[dccee02]: https://github.com/jeffutter/dokku-riakcs-plugin/commit/dccee02702e7001851917b7814e78a99148fb709
@@ -175,32 +185,37 @@ Note: The following plugins have been supplied by our community and may not have
| Plugin | Author | Compatibility |
| ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- |
| [App name as env](https://github.com/cjblomqvist/dokku-app-name-env) | [cjblomqvist][] | 0.3.x |
| [App User](https://github.com/expa/dokku-app-user) | [michaelshobbs][] | 0.4.0+ |
| [Dokku Clone](https://github.com/crisward/dokku-clone) | [crisward][] | 0.4.0+ |
| [Docker Direct](https://github.com/heichblatt/dokku-docker-direct) | [heichblatt][] | |
| [Dokku Copy App Config Files](https://github.com/alexkruegger/dokku-app-configfiles) | [alexkruegger][] | Compatible with 0.3.17+ |
| [Dokku Copy App Config Files](https://github.com/heichblatt/dokku-supply-config) | [heichblatt][] | |
| [Dokku Name](https://github.com/alex-sherwin/dokku-name) | [alex-sherwin][] | dokku >= [c77cbf1][] |
| [Dokku Registry](https://github.com/agco-adm/dokku-registry)<sup>1</sup> | [agco-adm][] | 0.4.0+ |
| [Dokku Require](https://github.com/crisward/dokku-require)<sup>2</sup> | [crisward][] | 0.4.0+ |
| [git rev-parse HEAD in env](https://github.com/cjblomqvist/dokku-git-rev) | [cjblomqvist][] | 0.4.0+ |
| [Graduate (Environment Management)](https://github.com/glassechidna/dokku-graduate) | [Benjamin-Dobell][] | 0.3.14+ |
| [Haproxy tcp load balancer](https://github.com/256dpi/dokku-haproxy) | [256dpi][] | 0.4.0+ |
| [HTTP Auth Secure Apps](https://github.com/matto1990/dokku-secure-apps) | [matto1990][] | 0.4.0+ |
| [Hostname](https://github.com/michaelshobbs/dokku-hostname) | [michaelshobbs][] | 0.4.0+ |
| [Lets Encrypt](https://github.com/sseemayer/dokku-letsencrypt) | [sseemayer][] | 0.4.0+ |
| [Multi-Buildpack](https://github.com/pauldub/dokku-multi-buildpack) | [pauldub][] | |
| [Nuke Containers](https://github.com/heichblatt/dokku-nuke) | [heichblatt][] | |
| [Open App Ports](https://github.com/heichblatt/dokku-ports) | [heichblatt][] | |
| [Pre-Deploy Tasks](https://github.com/michaelshobbs/dokku-app-predeploy-tasks) | [michaelshobbs][] | 0.4.0+ |
| [SSH Deployment Keys](https://github.com/cedricziel/dokku-deployment-keys)<sup>2</sup> | [cedricziel][] | 0.3.x |
| [SSH Hostkeys](https://github.com/cedricziel/dokku-hostkeys-plugin)<sup>3</sup> | [cedricziel][] | 0.3.x |
| [Proctype Filter](https://github.com/expa/dokku-proctype-filter) | [michaelshobbs][] | 0.4.0+ |
| [SSH Deployment Keys](https://github.com/cedricziel/dokku-deployment-keys)<sup>3</sup> | [cedricziel][] | 0.3.x |
| [SSH Hostkeys](https://github.com/cedricziel/dokku-hostkeys-plugin)<sup>4</sup> | [cedricziel][] | 0.3.x |
| [Volume (persistent storage)](https://github.com/ohardy/dokku-volume) | [ohardy][] | 0.3.x |
[217d00a]: https://github.com/dokku/dokku/commit/217d00a1bc47a7e24d8847617bb08a1633025fc7
<sup>1</sup> On Heroku similar functionality is offered by the [heroku-labs pipeline feature](https://devcenter.heroku.com/articles/labs-pipelines), which allows you to promote builds across multiple environments (staging -> production)
<sup>2</sup> Adds the possibility to add SSH deployment keys to receive private hosted packages
<sup>2</sup> Extends app.json support to include creating volumes and creating / linking databases on push
<sup>3</sup> Adds the ability to add custom hosts to the containers known_hosts file to be able to ssh them easily (useful with deployment keys)
<sup>3</sup> Adds the possibility to add SSH deployment keys to receive private hosted packages
<sup>4</sup> Adds the ability to add custom hosts to the containers known_hosts file to be able to ssh them easily (useful with deployment keys)
### Other Plugins
@@ -219,14 +234,19 @@ Note: The following plugins have been supplied by our community and may not have
| [Graphite/statsd](https://github.com/jlachowski/dokku-graphite-plugin) | [jlachowski] | <0.4.0 |
| [Graphite/statsd](https://github.com/jlachowski/dokku-graphite-grafana) | [jlachowski] | 0.4.0+, graphite & statsd plugin with grafana dashboard frontend |
| [Logspout](https://github.com/michaelshobbs/dokku-logspout) | [michaelshobbs][] | 0.3.26+ |
| [Monorepo](https://github.com/iamale/dokku-monorepo) | [iamale][] | 0.4.0+ |
| [Node](https://github.com/pnegahdar/dokku-node) | [pnegahdar][] | |
| [Node](https://github.com/ademuk/dokku-nodejs) | [ademuk][] | |
| [Reset mtime](https://github.com/mixxorz/dokku-docker-reset-mtime) | [mixxorz][] | 0.3.15+, Dockerfile support |
| [Slack Notifications](https://github.com/ribot/dokku-slack) | [ribot][] | 0.4.0+ |
| [Tor](https://github.com/michaelshobbs/dokku-tor) | [michaelshobbs][] | 0.4.0+ |
| [User ACL](https://github.com/mlebkowski/dokku-acl) | [Maciej Łebkowski][] | 0.4.0+ |
| [Webhooks](https://github.com/nickstenning/dokku-webhooks) | [nickstenning][] | |
| [Wkhtmltopdf](https://github.com/mbriskar/dokku-wkhtmltopdf) | [mbriskar][] | |
| [Wordpress](https://github.com/dudagroup/dokku-wordpress-template) | [abossard][] | Dokku dev, mariadb, volume, domains |
| [Long Timeout](https://github.com/investtools/dokku-long-timeout-plugin) | [investtools][] | 0.4.0+ |
| [Hostname](https://github.com/michaelshobbs/dokku-hostname) | [michaelshobbs][] | 0.4.0+ |
| [Rollbar](https://github.com/iloveitaly/dokku-rollbar) | [iloveitaly][] | 0.5.0+ |
<sup>1</sup> Forked from [jezdez/dokku-elasticsearch-plugin](https://github.com/jezdez/dokku-elasticsearch-plugin): uses Elasticsearch 1.2 (instead of 0.90), doesn't depend on dokku-link, runs as elasticsearch user instead of root, and turns off multicast autodiscovery for use in a VPS environment.

38
docs/proxy.md Normal file
View File

@@ -0,0 +1,38 @@
# Proxy plugin
> New as of 0.5.0
> Port handling functionality is new as of 0.6.0
As of dokku 0.5.0, the proxy functionality has been decoupled from the nginx-vhosts plugin into the proxy plugin. In the future this will allow other proxy software (HAproxy for example) to be used instead of nginx.
```
proxy <app> Show proxy settings for app
proxy:disable <app> Disable proxy for app
proxy:enable <app> Enable proxy for app
proxy:ports <app> List proxy port mappings for app
proxy:ports-add <app> <scheme>:<host-port>:<container-port> [<scheme>:<host-port>:<container-port>...] Set proxy port mappings for app
proxy:ports-clear <app> Clear all proxy port mappings for app
proxy:ports-remove <app> <host-port> [<host-port>...] Unset proxy port mappings for app
proxy:set <app> <proxy-type> Set proxy type for app
```
## Container network interface binding
By default, the deployed docker container running your app's web process will bind to the internal docker network interface (i.e. `docker inspect --format '{{ .NetworkSettings.IPAddress }}' $CONTAINER_ID`). This behavior can be modified per app by disabling the proxy (i.e. `dokku proxy:disable <app>`). In this case, the container will bind to an external interface (i.e. 0.0.0.0) and your app container will be directly accessible by other hosts on your network.
> If a proxy is disabled, dokku will bind your container's port to a random port on the host, e.g. `0.0.0.0:32771->5000/tcp`.
```shell
# container bound to docker interface
root@dokku:~/dokku# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1b88d8aec3d1 dokku/node-js-app:latest "/bin/bash -c '/star About a minute ago Up About a minute node-js-app.web.1
root@dokku:~/dokku# docker inspect --format '{{ .NetworkSettings.IPAddress }}' node-js-app.web.1
172.17.0.6
# container bound to all interfaces
root@dokku:/home/dokku# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d6499edb0edb dokku/node-js-app:latest "/bin/bash -c '/star About a minute ago Up About a minute 0.0.0.0:49153->5000/tcp node-js-app.web.1
```

View File

@@ -10,34 +10,49 @@
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400:sans-serif|Open+Sans:400:sans-serif" rel="stylesheet" type="text/css">
<title>Dokku - The smallest PaaS implementation you've ever seen</title>
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/manifest.json">
<link rel="shortcut icon" href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/favicon.ico">
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/manifest.json">
<link rel="shortcut icon" href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/favicon.ico">
<meta name="apple-mobile-web-app-title" content="Dokku">
<meta name="application-name" content="Dokku">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-TileImage" content="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/favicons/browserconfig.xml">
<meta name="msapplication-TileImage" content="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/favicons/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.rawgit.com/dokku/dokku/v0.4.10/docs/assets/style.css" rel="stylesheet">
<script>
if ('{{DOC}}' == 'index.md') {
var indexLink = '/{{NAME}}/';
if ('{{REF}}' !== 'master') {
indexLink = '/{{NAME}}~{{REF}}/';
}
window.location.replace(window.location.origin + indexLink);
}
</script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.rawgit.com/dokku/dokku/v0.6.2/docs/assets/style.css" rel="stylesheet">
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet">
<style>
</style>
</head>
<body>
<div class="dev-warning doc-floating-warning" style="display:none">
This document is for dokku's development version, which can be significantly different from previous releases. For older releases, use the version selector floating in the bottom right corner of this page.
</div>
<div class="header">
<div class="container-fluid">
<div class="row">
@@ -45,6 +60,23 @@
<h1 class="heading navbar-brand">
<a href="http://dokku.viewdocs.io/dokku/">Dokku</a>
</h1>
<ul class="nav nav-pills pull-xs-right col-md-offset-right-2">
<li class="nav-item">
<a class="nav-link" href="https://dokku.github.io/">Blog</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://github.com/dokku/dokku/">Code</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/{{NAME}}/installation/">Docs</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://webchat.freenode.net/?channels=dokku">IRC</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://glider-slackin.herokuapp.com/">Slack</a>
</li>
</ul>
</div>
</div>
</div>
@@ -59,7 +91,7 @@
<div class="list-group">
<a href="#" class="list-group-item disabled">Getting Started</a>
<a href="/dokku/installation/" class="list-group-item">Getting Started with Dokku</a>
<a href="/dokku/upgrading/" class="list-group-item">Upgrading</a>
<a href="/dokku/upgrading/" class="list-group-item">Upgrading Dokku</a>
<a href="/dokku/troubleshooting/" class="list-group-item">Troubleshooting</a>
<a href="/dokku/getting-started/where-to-get-help/" class="list-group-item">Getting Help</a>
@@ -70,19 +102,28 @@
<a href="/dokku/deployment/dockerfiles/" class="list-group-item">Dockerfile Deployment</a>
<a href="/dokku/deployment/images/" class="list-group-item">Image Tagging</a>
<a href="/dokku/remote-commands/" class="list-group-item">Remote Commands</a>
<a href="/dokku/deployment/one-off-processes/" class="list-group-item">One Off Processes</a>
<a href="/dokku/deployment/one-off-processes/" class="list-group-item">One Off Processes/Cron</a>
<a href="/dokku/process-management/" class="list-group-item">Scaling Apps</a>
<a href="/dokku/checks-examples/" class="list-group-item">Zero Downtime Deploys</a>
<a href="/dokku/deployment/user-management/" class="list-group-item">User Management</a>
<a href="/dokku/checks-examples/" class="list-group-item">Zero Downtime Deploy Checks</a>
<a href="#" class="list-group-item disabled">Configuration</a>
<a href="/dokku/configuration-management/" class="list-group-item">Environment Variables</a>
<a href="/dokku/dns" class="list-group-item">DNS Configuration</a>
<a href="/dokku/dns/" class="list-group-item">DNS Configuration</a>
<a href="/dokku/deployment/domain-configuration/" class="list-group-item">Domain Configuration</a>
<a href="/dokku/nginx/" class="list-group-item">Nginx Configuration</a>
<a href="/dokku/deployment/ssl-configuration/" class="list-group-item">SSL Configuration</a>
<a href="/dokku/docker-options/" class="list-group-item">Docker Container Options</a>
<a href="/dokku/dokku-events-logs/" class="list-group-item">Dokku Event Logs</a>
<a href="#" class="list-group-item disabled">Advanced Usage</a>
<a href="/dokku/backup-recovery/" class="list-group-item">Backup and Recovery</a>
<a href="/dokku/deployment/deployment-tasks/" class="list-group-item">Deployment Tasks</a>
<a href="/dokku/docker-options/" class="list-group-item">Docker Container Options</a>
<a href="/dokku/dokku-storage/" class="list-group-item">Persistent Storage</a>
<a href="/dokku/proxy/" class="list-group-item">Proxy Management</a>
<a href="#" class="list-group-item disabled">Community Contributions</a>
<a href="/dokku/community/clients/" class="list-group-item">Clients</a>
@@ -99,9 +140,39 @@
</div>
</div>
<div class="rst-versions rst-badge" data-toggle="rst-versions">
<span class="rst-current-version" data-toggle="rst-current-version" data-doc="{{DOC}}" data-ref="{{REF}}">
<span class="fa fa-book">&nbsp;</span>
v: {{REF}}
<span class="fa fa-caret-down"></span>
</span>
<div class="rst-other-versions">
<dl>
<dt>Versions</dt>
</dl>
<dl>
<dt>On GitHub</dt>
<dd>
<a href="https://github.com/{{USER}}/{{NAME}}/blob/master/docs/{{DOC}}" target="_blank">View</a>
</dd>
<dd>
<a href="https://github.com/{{USER}}/{{NAME}}/edit/master/docs/{{DOC}}" target="_blank">Edit</a>
</dd>
</dl>
<hr>
Free document hosting provided by <a href="http://progrium.viewdocs.io/viewdocs/">Viewdocs</a>.
</div>
</div>
<div class="dev-warning doc-floating-warning" style="display:none">
This document is for dokku's development version, which can be significantly different from previous releases. For older releases, use the version selector floating in the bottom right corner of this page.
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/1.3.0/anchor.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function (e) {
document.addEventListener('DOMContentLoaded', function (e) {
var markdownBody = document.querySelectorAll('.markdown-body')[0],
isRedirect = markdownBody.innerHTML.trim().indexOf('<p>See the <a href=') === 0;
if (isRedirect) {
@@ -113,18 +184,107 @@
var tables = document.querySelectorAll('table'),
blockquotes = document.querySelectorAll('blockquote'),
versionList = document.querySelectorAll('.rst-other-versions dl')[0],
currentVersionEl = document.querySelectorAll('.rst-current-version')[0],
currentVersion = currentVersionEl.getAttribute('data-ref'),
versionContainer = document.querySelectorAll('.rst-versions.rst-badge')[0],
pageHeader = document.querySelectorAll('.markdown-body p')[0],
headers = document.querySelectorAll('h2, h3, h4'),
classNames = ['table', 'table-striped', 'table-hover', 'table-condensed'],
localPath = location.pathname.split('/').splice(2).join("/"),
addClass = function (el, className) {
if (el.classList) {
el.classList.add(className);
} else {
el.className += ' ' + className;
}
},
addListener = function (elem, type, fn) {
if (elem.addEventListener) {
elem.addEventListener(type, fn, false);
} else if (elem.attachEvent) {
elem.attachEvent("on" + type, function() {
return fn.call(elem, window.event);
});
} else {
elem["on" + type] = fn;
}
},
hasClass = function(el, className) {
if (el.classList) {
return el.classList.contains(className);
} else {
return new RegExp('(^| )' + className + '( |$)', 'gi').test(el.className);
}
},
removeClass = function(el, className) {
if (el.classList) {
el.classList.remove(className);
} else {
el.className = el.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), ' ');;
}
};
var ls2 = {
save : function(key, jsonData, expirationMS) {
if (typeof (Storage) == "undefined") { return false; }
var record = {value: JSON.stringify(jsonData), timestamp: new Date().getTime()/1000 + expirationMS}
localStorage.setItem(key, JSON.stringify(record));
return jsonData;
},
load : function(key) {
if (typeof (Storage) == "undefined") { return false; }
var record = JSON.parse(localStorage.getItem(key));
if (!record){return false;}
return (new Date().getTime()/1000 < record.timestamp && JSON.parse(record.value));
}
};
var ToC =
"<nav role='navigation' class='table-of-contents'>" +
"<ul>";
var newLine, el, title, link, currentDepth, count = 0, lastNodeDepth = null;
Array.prototype.forEach.call(headers, function (el, i) {
count++;
title = el.innerText || element.textContent;
link = "#" + el.getAttribute('id');
currentDepth = parseInt(el.nodeName.replace('H', ''), 10);
newLine =
"<li>" +
"<a href='" + link + "' class='current-depth-" + currentDepth + "'>" +
title +
"</a>" +
"</li>";
if (currentDepth === lastNodeDepth || lastNodeDepth === null) {
} else if (currentDepth > lastNodeDepth) {
newLine = '<ul>' + newLine;
} else if (currentDepth < lastNodeDepth) {
newLine = '</ul>' + newLine;
}
ToC += newLine;
lastNodeDepth = currentDepth;
});
ToC += "</ul></nav>";
if (count > 1) {
var navItems = document.querySelectorAll('.list-group-item');
Array.prototype.forEach.call(navItems, function(el, i){
if (el.getAttribute('href') == location.pathname) {
el.insertAdjacentHTML('afterEnd', ToC);
}
});
}
Array.prototype.forEach.call(blockquotes, function (el, i) {
if (el.innerHTML.indexOf('New as of') !== -1) {
if (el.innerHTML.toLowerCase().indexOf('new as of') !== -1) {
addClass(el, 'new-as-of');
} else if (el.innerHTML.toLowerCase().indexOf('not yet released') !== -1) {
addClass(el, 'not-yet-released');
}
});
Array.prototype.forEach.call(classNames, function (className, i) {
@@ -132,6 +292,102 @@
addClass(el, className);
});
});
addListener(currentVersionEl, 'click', function() {
if (hasClass(versionContainer, 'shift-up')) {
removeClass(versionContainer, 'shift-up');
} else {
addClass(versionContainer, 'shift-up');
}
});
var range = function(start, count) {
return Array.apply(0, Array(count))
.map(function (element, index) {
return index + start;
});
}
var parseVersions = function(version, versions) {
var pieces = version.split('.'),
prefix = pieces.slice(0, 2).join('.') + '.',
maxPatchVersion = parseInt(pieces.slice(2, 3)[0], 10),
versionRange = range(0, maxPatchVersion + 1);
for (var i in versionRange) {
versions.push(prefix.concat(versionRange[i]));
}
return versions;
}
var addVersionLink = function(version) {
var a = document.createElement('a'),
dd = document.createElement('dd'),
ref = 'dokku~v' + version,
versionName = 'v' + version;
if (version == 'master') {
ref = 'dokku';
versionName = 'master';
}
a.setAttribute('href', "/" + ref + "/" + localPath);
a.appendChild(document.createTextNode(versionName));
if (versionName == currentVersion) {
var strong = document.createElement('strong');
strong.appendChild(a);
dd.appendChild(strong);
} else {
dd.appendChild(a);
}
versionList.appendChild(dd);
};
var processVersions = function(data) {
var versions = [];
for (var key in data['max-versions']) {
if (!data['max-versions'].hasOwnProperty(key)) {
continue;
}
versions = parseVersions(data['max-versions'][key], versions);
}
addVersionLink('master');
Array.prototype.forEach.call(versions, function (version, i) {
addVersionLink(version);
});
};
if (currentVersion === 'master') {
document.querySelectorAll('.dev-warning')[0].style.position = 'relative';
Array.prototype.forEach.call(document.querySelectorAll('.dev-warning'), function (el, i) {
el.style.display = '';
});
}
data = ls2.load('max-versions');
if (!data) {
var request = new XMLHttpRequest();
request.open('GET', '/dokku/assets/versions.json', true);
request.setRequestHeader("Cache-Control", "no-cache, no-store");
request.onload = function() {
if (request.status >= 200 && request.status < 400) {
var data = JSON.parse(request.responseText);
// store for 1 day
ls2.save('max-versions', data, 86400);
processVersions(data);
}
};
request.onerror = function() {
// There was a connection error of some sort
};
request.send();
} else {
processVersions(data);
}
});
</script>
</body>

View File

@@ -1,4 +1,4 @@
## Troubleshooting
# Troubleshooting
__Symptom:__ I deployed my app but I am getting the default nginx page

View File

@@ -1,26 +1,33 @@
# Upgrading
This document covers upgrades for the 0.3.0 series and up. If upgrading from older versions, we recommend [a fresh install](http://dokku.viewdocs.io/dokku/installation) on a new server.
If your version of dokku is pre 0.3.0 (check with `dokku version`), we recommend [a fresh install](/dokku/installation) on a new server.
> As of 0.3.18, dokku is installed by default via a debian package. Source-based installations are still available, though not recommended.
## Migration Guides
## Dokku
Before upgrading, check the migration guides to get comfortable with new features and prepare your deployment to be upgraded.
If dokku was installed via a debian package, you can upgrade dokku via the following command:
- [0.5 Migration Guide](/dokku/appendices/0.5.0-migration-guide/)
- [0.6 Migration Guide](/dokku/appendices/0.6.0-migration-guide/)
## Upgrade Instructions
If dokku was installed via `apt-get install dokku` or `bootstrap.sh` (most common), upgrade with:
```shell
sudo apt-get install dokku
sudo apt-get update
dokku apps
dokku ps:stop <app> # repeat to shut down each running app
sudo apt-get install -qq -y dokku herokuish
dokku ps:rebuildall # restart all applications
```
For unattended upgrades, you may run the following command:
```shell
sudo apt-get install -qq -y dokku
```
If you have installed dokku from source, you may run the following commands to upgrade:
### Upgrade From Source
If you installed dokku from source (less common), upgrade with:
```shell
dokku apps
dokku ps:stop <app> # repeat to shut down each running app
cd ~/dokku
git pull --tags origin master
@@ -29,29 +36,10 @@ sudo DOKKU_BRANCH=master make install
# upgrade to debian package-based installation
sudo make install
dokku ps:rebuildall # restart all applications
```
All changes will take effect upon next application deployment. To trigger a rebuild of every application, simply run the following command:
```shell
dokku ps:rebuildall
```
## Herokuish image
If dokku was installed via a debian package, you can upgrade herokuish via the following command:
```shell
sudo apt-get install herokuish
```
For unattended upgrades, you may run the following command:
```shell
sudo apt-get install -qq -y herokuish
```
In some cases, it may be desirable to run a specific version of herokuish. To install/upgrade herokuish from source, run the following commands:
To upgrade herokuish from source, upgrade with:
```shell
cd /tmp

296
dokku
View File

@@ -2,7 +2,15 @@
set -eo pipefail
shopt -s nullglob
export DOKKU_ROOT=${DOKKU_ROOT:=~dokku}
[[ -f $DOKKU_ROOT/dokkurc ]] && source "$DOKKU_ROOT/dokkurc"
[[ -d $DOKKU_ROOT/.dokkurc ]] && for f in $DOKKU_ROOT/.dokkurc/*; do source "$f"; done
[[ $DOKKU_TRACE ]] && set -x
case "$(lsb_release -si)" in
Arch)
export DOKKU_DISTRO=${DOKKU_DISTRO:="arch"}
;;
Debian)
export DOKKU_DISTRO=${DOKKU_DISTRO:="debian"}
;;
@@ -12,7 +20,6 @@ case "$(lsb_release -si)" in
esac
export DOKKU_IMAGE=${DOKKU_IMAGE:="gliderlabs/herokuish"}
export DOKKU_ROOT=${DOKKU_ROOT:=~dokku}
export DOKKU_LIB_ROOT=${DOKKU_LIB_PATH:="/var/lib/dokku"}
export PLUGIN_PATH=${PLUGIN_PATH:="$DOKKU_LIB_ROOT/plugins"}
@@ -34,16 +41,13 @@ export DOKKU_GLOBAL_RUN_ARGS="--label=$DOKKU_CONTAINER_LABEL"
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
[[ -f $DOKKU_ROOT/dokkurc ]] && source $DOKKU_ROOT/dokkurc
[[ -d $DOKKU_ROOT/.dokkurc ]] && for f in $DOKKU_ROOT/.dokkurc/*; do source $f; done
[[ $DOKKU_TRACE ]] && set -x
parse_args "$@"
args=("$@")
if [[ "${args[0]}" =~ ^--.* ]]; then
for arg in "$@"; do
if [[ "$arg" =~ ^--.* ]]; then
if [[ "$arg" == "--app" ]]; then
shift 2
elif [[ "$arg" =~ ^--.* ]]; then
shift 1
else
break
@@ -54,21 +58,23 @@ fi
if [[ $(id -un) != "dokku" ]] && [[ ! $1 =~ plugin:* ]]; then
export SSH_USER=$(id -un)
sudo -u dokku -E -H $0 "$@"
sudo -u dokku -E -H "$0" "$@"
exit $?
fi
if [[ $(id -un) != "root" && $1 =~ plugin:.* ]]; then
if [[ $(id -un) != "root" && $1 =~ ^plugin:.* ]]; then
dokku_log_fail "plugin:* commands must be run as root"
fi
if [[ -n "$SSH_ORIGINAL_COMMAND" ]]; then
export -n SSH_ORIGINAL_COMMAND
if [[ $1 =~ config-* ]] || [[ $1 =~ docker-options* ]]; then
# shellcheck disable=SC2086
xargs $0 <<<$SSH_ORIGINAL_COMMAND
exit $?
else
set -f
# shellcheck disable=SC2086
$0 $SSH_ORIGINAL_COMMAND
set +f
exit $?
@@ -80,196 +86,126 @@ if ! dokku_auth "$@" ; then
exit 1
fi
case "$1" in
receive)
APP="$2"; IMAGE=$(get_app_image_name $APP); IMAGE_SOURCE_TYPE="$3"; TMP_WORK_DIR="$4"
dokku_log_info1 "Cleaning up..."
docker_cleanup
dokku_log_info1 "Building $APP from $IMAGE_SOURCE_TYPE..."
dokku build "$APP" "$IMAGE_SOURCE_TYPE" "$TMP_WORK_DIR"
release_and_deploy "$APP"
;;
execute_dokku_cmd() {
declare desc="executes dokku sub-commands"
local PLUGIN_NAME="$1"
local PLUGIN_CMD=$PLUGIN_NAME
local implemented=0; local script
local argv=("$@")
deploy)
[[ -z $2 ]] && dokku_log_fail "Please specify an app to deploy"
APP="$2"; IMAGE_TAG="$3"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
verify_app_name "$APP"
plugn trigger pre-deploy $APP $IMAGE_TAG
case "$PLUGIN_NAME" in
events|events:*)
local PLUGIN_NAME=${PLUGIN_NAME/events/20_events}
;;
nginx|nginx:*)
local PLUGIN_NAME=${PLUGIN_NAME/nginx/nginx-vhosts}
;;
deploy|delete|ls|run|cleanup)
local PLUGIN_NAME="00_dokku-standard"
;;
trace|url|urls|report|version)
local PLUGIN_NAME="00_dokku-standard"
;;
esac
is_image_herokuish_based "$IMAGE" && DOKKU_HEROKUISH=true
DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE"
oldids=$(get_app_container_ids $APP)
DOKKU_APP_SKIP_ALL_CHECKS=$(dokku config:get $APP DOKKU_SKIP_ALL_CHECKS || true)
DOKKU_APP_SKIP_DEFAULT_CHECKS=$(dokku config:get $APP DOKKU_SKIP_DEFAULT_CHECKS || true)
DOKKU_GLOBAL_SKIP_ALL_CHECKS=$(dokku config:get --global DOKKU_SKIP_ALL_CHECKS || true)
DOKKU_GLOBAL_SKIP_DEFAULT_CHECKS=$(dokku config:get --global DOKKU_SKIP_DEFAULT_CHECKS || true)
DOKKU_SKIP_ALL_CHECKS=${DOKKU_APP_SKIP_ALL_CHECKS:="$DOKKU_GLOBAL_SKIP_ALL_CHECKS"}
DOKKU_SKIP_DEFAULT_CHECKS=${DOKKU_APP_SKIP_DEFAULT_CHECKS:="$DOKKU_GLOBAL_SKIP_DEFAULT_CHECKS"}
DOKKU_DEFAULT_DOCKER_ARGS=$(: | plugn trigger docker-args-deploy $APP $IMAGE_TAG)
while read -r line || [[ -n "$line" ]]; do
[[ "$line" =~ ^#.* ]] && continue
TRIM=${line%#*}
PROC_TYPE=${TRIM%%=*}
PROC_COUNT=${TRIM#*=}
CONTAINER_INDEX=1
while [[ $CONTAINER_INDEX -le $PROC_COUNT ]]; do
id=""; port=""; ipaddr=""
DOKKU_CONTAINER_ID_FILE="$DOKKU_ROOT/$APP/CONTAINER.$PROC_TYPE.$CONTAINER_INDEX"
DOKKU_IP_FILE="$DOKKU_ROOT/$APP/IP.$PROC_TYPE.$CONTAINER_INDEX"
DOKKU_PORT_FILE="$DOKKU_ROOT/$APP/PORT.$PROC_TYPE.$CONTAINER_INDEX"
# start the app
DOCKER_ARGS="$DOKKU_DEFAULT_DOCKER_ARGS"
DOCKER_ARGS+=" -e DYNO='$PROC_TYPE.$CONTAINER_INDEX' "
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true "
BIND_EXTERNAL=$(plugn trigger bind-external-ip $APP)
[[ -n "$DOKKU_HEROKUISH" ]] && START_CMD="/start $PROC_TYPE"
if [[ -z "$DOKKU_HEROKUISH" ]]; then
DOKKU_DOCKERFILE_PORT=$(dokku config:get $APP DOKKU_DOCKERFILE_PORT || true)
START_CMD=$(dokku config:get $APP DOKKU_DOCKERFILE_START_CMD || $START_CMD)
fi
if [[ "$PROC_TYPE" == "web" ]]; then
port=${DOKKU_DOCKERFILE_PORT:=5000}
if [[ "$BIND_EXTERNAL" = "true" ]]; then
id=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d -p $port -e PORT=$port $DOCKER_ARGS $IMAGE $START_CMD)
port=$(docker port $id $port | sed 's/[0-9.]*://')
ipaddr=127.0.0.1
else
id=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d -e PORT=$port $DOCKER_ARGS $IMAGE $START_CMD)
ipaddr=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $id)
# Docker < 1.9 compatibility
if [[ -z $ipaddr ]]; then
ipaddr=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' $id)
fi
fi
else
id=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d $DOCKER_ARGS $IMAGE $START_CMD)
fi
# if we can't post-deploy successfully, kill new container
kill_new() {
docker inspect $id &> /dev/null && docker stop $id > /dev/null && docker kill $id > /dev/null
trap - INT TERM EXIT
kill -9 $$
}
# run checks first, then post-deploy hooks, which switches Nginx traffic
if [[ "$DOKKU_SKIP_ALL_CHECKS" = "true" ]]; then
dokku_log_info1 "Skipping pre-flight checks"
else
trap kill_new INT TERM EXIT
dokku_log_info1 "Running pre-flight checks"
plugn trigger check-deploy $APP $id $PROC_TYPE $port $ipaddr
trap - INT TERM EXIT
fi
# now using the new container
[[ -n "$id" ]] && echo $id > "$DOKKU_CONTAINER_ID_FILE"
[[ -n "$ipaddr" ]] && echo $ipaddr > "$DOKKU_IP_FILE"
[[ -n "$port" ]] && echo $port > "$DOKKU_PORT_FILE"
[[ -n "$port" ]] && echo "http://$(< "$DOKKU_ROOT/HOSTNAME"):$port" > "$DOKKU_ROOT/$APP/URL"
# cleanup pre-migration files
rm -f $DOKKU_ROOT/$APP/CONTAINER $DOKKU_ROOT/$APP/IP $DOKKU_ROOT/$APP/PORT
CONTAINER_INDEX=$(( CONTAINER_INDEX + 1 ))
done
# cleanup when we scale down
if [[ "$PROC_COUNT" == 0 ]]; then
CONTAINER_IDX_OFFSET=0
if [[ "$(readlink -f "$PLUGIN_ENABLED_PATH/${PLUGIN_NAME%%:*}")" == *core-plugins* ]] ; then
[[ ${argv[0]} == "$PLUGIN_CMD" ]] && shift 1
if [[ ! -z $DOKKU_APP_NAME ]]; then
if [[ "$PLUGIN_CMD" == config* ]] && [[ ${argv[1]} == "--no-restart" ]]; then
shift 1
set -- "--no-restart" "$DOKKU_APP_NAME" "$@"
else
CONTAINER_IDX_OFFSET=$((PROC_COUNT + 1))
set -- "$DOKKU_APP_NAME" "$@"
fi
for container_state_filetype in CONTAINER IP PORT; do
cd $DOKKU_ROOT/$APP
find . -maxdepth 1 -name "$container_state_filetype.$PROC_TYPE.*" -printf "%f\n" | sort -t . -k 3 -n | tail -n +$CONTAINER_IDX_OFFSET | xargs rm -f
done
done < "$DOKKU_SCALE_FILE"
dokku_log_info1 "Running post-deploy"
plugn trigger post-deploy $APP $port $ipaddr
# kill the old container
if [[ -n "$oldids" ]]; then
if [[ -z "$DOKKU_WAIT_TO_RETIRE" ]]; then
DOKKU_APP_DOKKU_WAIT_TO_RETIRE=$(dokku config:get $APP DOKKU_WAIT_TO_RETIRE || true)
DOKKU_GLOBAL_DOKKU_WAIT_TO_RETIRE=$(dokku config:get --global DOKKU_WAIT_TO_RETIRE || true)
DOKKU_WAIT_TO_RETIRE=${DOKKU_APP_DOKKU_WAIT_TO_RETIRE:="$DOKKU_GLOBAL_DOKKU_WAIT_TO_RETIRE"}
fi
# Let the old container finish processing requests, before terminating it
WAIT="${DOKKU_WAIT_TO_RETIRE:-60}"
dokku_log_info1 "Shutting down old containers in $WAIT seconds"
for oldid in $oldids; do
dokku_log_info2 "$oldid"
done
(
exec >/dev/null 2>/dev/null </dev/null
trap '' INT HUP
sleep $WAIT
for oldid in $oldids; do
# Attempt to stop, if that fails, then force a kill as docker seems
# to not send SIGKILL as the docs would indicate. If that fails, move
# on to the next.
docker stop $oldid \
|| docker kill $oldid \
|| plugn trigger retire-container-failed $APP # plugin trigger for event logging
done
) & disown -a
# Use trap since disown/nohup don't seem to keep child alive
# Give child process just enough time to set the traps
sleep 0.1
fi
;;
set -- "$PLUGIN_CMD" "$@"
fi
cleanup)
docker_cleanup
;;
if [[ -x $PLUGIN_ENABLED_PATH/$PLUGIN_NAME/subcommands/default ]]; then
"$PLUGIN_ENABLED_PATH/$PLUGIN_NAME/subcommands/default" "$@"
implemented=1
elif [[ -x $PLUGIN_ENABLED_PATH/$PLUGIN_NAME/subcommands/$PLUGIN_CMD ]]; then
"$PLUGIN_ENABLED_PATH/$PLUGIN_NAME/subcommands/$PLUGIN_CMD" "$@"
implemented=1
elif [[ -x $PLUGIN_ENABLED_PATH/${PLUGIN_NAME%%:*}/subcommands/${1#*:} ]]; then
"$PLUGIN_ENABLED_PATH/${PLUGIN_NAME%%:*}/subcommands/${1#*:}" "$@"
implemented=1
fi
# DEPRECATED as of v0.3.14
deploy:all)
echo "*DEPRECATED* in v0.3.14: deploy:all will be removed in future versions"
dokku ps:restartall
;;
help|'')
echo "Usage: dokku [--quiet|--trace|--rm-container|--rm|--force] COMMAND <app> [command-specific-options]"
echo ""
echo "Options:"
cat<<EOF | plugn trigger commands help | sort | column -c2 -t -s,
help, Print the list of commands
EOF
;;
*)
implemented=0
if [[ $implemented -eq 0 ]];then
for script in $PLUGIN_ENABLED_PATH/*/commands; do
set +e; $script "$@" ; exit_code=$? ; set -e
if [[ "$exit_code" -eq "$DOKKU_NOT_IMPLEMENTED_EXIT" ]]; then
continue
fi
implemented=1
if [[ "$exit_code" -ne "$DOKKU_VALID_EXIT" ]]; then
exit $exit_code
fi
done
fi
if [[ "$implemented" -eq 0 ]]; then
dokku_log_warn "\`$*\` is not a dokku command."
dokku_log_warn "See \`dokku help\` for a list of available commands."
exit 1
if [[ "$implemented" -eq 0 ]]; then
dokku_log_warn "\`$*\` is not a dokku command."
dokku_log_warn "See \`dokku help\` for a list of available commands."
exit 1
fi
}
case "$1" in
help|'')
export LC_ALL=C # so sort will respect non alpha characters
ALL_PLUGIN_COMMANDS=$(find -L "$PLUGIN_PATH/enabled" -name commands 2> /dev/null || true)
# build list of core plugin command files
for plugin_command in $ALL_PLUGIN_COMMANDS;do
if [[ "$(readlink -f "$plugin_command")" == *core-plugins* ]]; then
CORE_PLUGIN_COMMANDS+="$plugin_command "
fi
done
# build list of non-core plugin command files
for plugin_command in $ALL_PLUGIN_COMMANDS;do
if [[ "$(readlink -f "$plugin_command")" != *core-plugins* ]]; then
COMMUNITY_PLUGIN_COMMANDS+="$plugin_command "
fi
done
# New lines are blank echos for readability
echo "Usage: dokku [--quiet|--trace|--rm-container|--rm|--force] COMMAND <app> [command-specific-options]"
echo ""
echo "Primary help options, type \"dokku COMMAND:help\" for more details, or dokku help --all to see all commands."
echo ""
echo "Commands:"
echo ""
if [[ "$2" == "--all" ]] ; then
for core_plugin_command in $CORE_PLUGIN_COMMANDS; do
$core_plugin_command help
done | sort | column -c2 -t -s,
echo ""
echo "Community plugin commands:"
echo ""
for community_plugin_command in $COMMUNITY_PLUGIN_COMMANDS; do
$community_plugin_command help
done | sort | column -c2 -t -s,
else
for core_plugin_command in $CORE_PLUGIN_COMMANDS; do
$core_plugin_command help
# When done, sort, sed cuts arugments out of strings and colum make it pretty
done | sort | sed -e '/^.*:/d' -e 's/\s[\[\<\-\(].*,/,/' | column -c2 -t -s,
if [[ -n "$COMMUNITY_PLUGIN_COMMANDS" ]]; then
echo ""
echo "Community plugin commands:"
echo ""
for community_plugin_command in $COMMUNITY_PLUGIN_COMMANDS; do
$community_plugin_command help
done | sort | column -c2 -t -s,
fi
fi
;;
*)
execute_dokku_cmd "$@"
;;
esac

View File

@@ -1,18 +0,0 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
VERSION="$1"
IMPORT_DIR="$2"
TARGET_DIR="$3"
APPS="$(< $4 )"
ret=0
for app in $APPS; do
if [[ -d $TARGET_DIR/$app ]]; then
ret=1
echo "Trying to import application $app which already exists." 2>&1
fi
done
exit $ret

View File

@@ -1,11 +0,0 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
VERSION="$1"
BASE_DIR="$2"
cat;
[[ -f $BASE_DIR/.sshcommand ]] && echo "$BASE_DIR/.sshcommand"
[[ -f $BASE_DIR/.ssh/authorized_keys ]] && echo "$BASE_DIR/.ssh/authorized_keys"
[[ -f $BASE_DIR/HOSTNAME ]] && echo "$BASE_DIR/HOSTNAME"
[[ -f $BASE_DIR/VHOST ]] && echo "$BASE_DIR/VHOST"

View File

@@ -1,16 +0,0 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
VERSION="$1"
IMPORT_DIR="$2"
TARGET_DIR="$3"
[[ -f $IMPORT_DIR/.sshcommand ]] && mv $IMPORT_DIR/.sshcommand $TARGET_DIR/.sshcommand
if [[ -f $IMPORT_DIR/.ssh/authorized_keys ]]; then
mkdir -p $TARGET_DIR/.ssh
cat $IMPORT_DIR/.ssh/authorized_keys $TARGET_DIR/.ssh/authorized_keys | uniq > tmpfile && mv tmpfile $TARGET_DIR/.ssh/authorized_keys
chmod 0700 $TARGET_DIR/.ssh
chmod 0600 $TARGET_DIR/.ssh/*
fi
[[ -f $IMPORT_DIR/HOSTNAME ]] && mv $IMPORT_DIR/HOSTNAME $TARGET_DIR/HOSTNAME
[[ -f $IMPORT_DIR/VHOST ]] && mv $IMPORT_DIR/VHOST $TARGET_DIR/VHOST

View File

@@ -1,228 +1,32 @@
#!/usr/bin/env bash
[[ " build release trace delete ls run url urls report version help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT
[[ " help help:help ls:help run:help trace:help url:help urls:help version:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/config/functions"
source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions"
case "$1" in
build)
APP="$2"; IMAGE_SOURCE_TYPE="$3"; TMP_WORK_DIR="$4"; IMAGE=$(get_app_image_name $APP)
verify_app_name "$APP"
CACHE_DIR="$DOKKU_ROOT/$APP/cache"
eval "$(config_export app $APP)"
pushd "$TMP_WORK_DIR" &> /dev/null
case "$IMAGE_SOURCE_TYPE" in
herokuish)
id=$(tar -c . | docker run $DOKKU_GLOBAL_RUN_ARGS -i -a stdin $DOKKU_IMAGE /bin/bash -c "mkdir -p /app && tar -xC /app")
test "$(docker wait $id)" -eq 0
docker commit $id $IMAGE > /dev/null
[[ -d $CACHE_DIR ]] || mkdir $CACHE_DIR
plugn trigger pre-build-buildpack "$APP"
DOCKER_ARGS=$(: | plugn trigger docker-args-build $APP $IMAGE_SOURCE_TYPE)
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true "
id=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d -v $CACHE_DIR:/cache -e CACHE_PATH=/cache $DOCKER_ARGS $IMAGE /build)
docker attach $id
test "$(docker wait $id)" -eq 0
docker commit $id $IMAGE > /dev/null
plugn trigger post-build-buildpack "$APP"
;;
dockerfile)
# extract first port from Dockerfile
DOCKERFILE_PORT=$(get_dockerfile_exposed_port Dockerfile)
[[ -n "$DOCKERFILE_PORT" ]] && config_set --no-restart $APP DOKKU_DOCKERFILE_PORT=$DOCKERFILE_PORT
plugn trigger pre-build-dockerfile "$APP"
[[ "$DOKKU_DOCKERFILE_CACHE_BUILD" == "false" ]] && DOKKU_DOCKER_BUILD_OPTS="$DOKKU_DOCKER_BUILD_OPTS --no-cache"
DOCKER_ARGS=$(: | plugn trigger docker-args-build $APP $IMAGE_SOURCE_TYPE)
docker build $DOCKER_ARGS $DOKKU_DOCKER_BUILD_OPTS -t "$IMAGE" .
plugn trigger post-build-dockerfile "$APP"
;;
*)
dokku_log_fail "Building image source type $IMAGE_SOURCE_TYPE not supported!"
;;
esac
;;
release)
APP="$2"; IMAGE_SOURCE_TYPE="$3"; IMAGE_TAG="$4"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
verify_app_name "$APP"
case "$IMAGE_SOURCE_TYPE" in
herokuish)
plugn trigger pre-release-buildpack "$APP" "$IMAGE_TAG"
if [[ -n $(config_export global) ]]; then
id=$(config_export global | docker run $DOKKU_GLOBAL_RUN_ARGS -i -a stdin $IMAGE /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/00-global-env.sh")
test "$(docker wait $id)" -eq 0
docker commit $id $IMAGE > /dev/null
fi
if [[ -n $(config_export app $APP) ]]; then
id=$(config_export app $APP | docker run $DOKKU_GLOBAL_RUN_ARGS -i -a stdin $IMAGE /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/01-app-env.sh")
test "$(docker wait $id)" -eq 0
docker commit $id $IMAGE > /dev/null
fi
plugn trigger post-release-buildpack "$APP" "$IMAGE_TAG"
;;
dockerfile)
# buildstep plugins don't necessarily make sense for dockerfiles. call the new breed!!!
plugn trigger pre-release-dockerfile "$APP" "$IMAGE_TAG"
plugn trigger post-release-dockerfile "$APP" "$IMAGE_TAG"
;;
*)
dokku_log_fail "Releasing image source type $IMAGE_SOURCE_TYPE not supported!"
;;
esac
;;
trace)
[[ -d $DOKKU_ROOT/.dokkurc ]] || mkdir -p $DOKKU_ROOT/.dokkurc
[[ "$2" == "on" ]] || [[ "$2" == "off" ]] || {
dokku_log_fail "Valid trace options are [on/off]"
}
if [[ "$2" == "on" ]]; then
echo "Enabling dokku trace"
echo "export DOKKU_TRACE=1" > $DOKKU_ROOT/.dokkurc/DOKKU_TRACE
fi
if [[ "$2" == "off" ]]; then
echo "Disabling dokku trace"
rm -f $DOKKU_ROOT/.dokkurc/DOKKU_TRACE
fi
;;
delete)
dokku apps:destroy $2
;;
ls)
installed_apps=$(dokku_apps)
dokku_col_log_info1_quiet "App Name" "Container Type" "Container Id" "Status"
for dokku_app in $installed_apps; do
APP=$(basename $dokku_app)
DOKKU_APP_CIDS=$(get_app_container_ids $APP)
DOCKER_RUNNING_CONTAINERS=$(docker ps -q --no-trunc)
if [[ -n $DOKKU_APP_CIDS ]]; then
for DOKKU_APP_CID in $DOKKU_APP_CIDS; do
DOKKU_APP_CONTAINER_STATUS="stopped"
[[ $DOCKER_RUNNING_CONTAINERS =~ $DOKKU_APP_CID ]] && DOKKU_APP_CONTAINER_STATUS="running"
DOKKU_APP_CONTAINER_TYPE=$(grep -l $DOKKU_APP_CID $DOKKU_ROOT/$APP/CONTAINER.* | awk -F '/' '{ print $5 }' | awk -F '.' '{ print $2 }')
dokku_col_log_msg "$APP" "$DOKKU_APP_CONTAINER_TYPE" "${DOKKU_APP_CID:0:12}" "$DOKKU_APP_CONTAINER_STATUS"
done
else
dokku_col_log_msg "$APP" "NOT_DEPLOYED" "NOT_DEPLOYED" "NOT_DEPLOYED"
fi
done
;;
run)
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
APP="$2"; IMAGE_TAG=$(get_running_image_tag $APP); IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
verify_app_name "$APP"
shift 2
DOKKU_APP_RM_CONTAINER=$(dokku config:get $APP DOKKU_RM_CONTAINER || true)
DOKKU_GLOBAL_RM_CONTAINER=$(dokku config:get --global DOKKU_RM_CONTAINER || true)
DOKKU_RM_CONTAINER=${DOKKU_APP_RM_CONTAINER:="$DOKKU_GLOBAL_RM_CONTAINER"}
DOCKER_ARGS=$(: | plugn trigger docker-args-run $APP $IMAGE_TAG)
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true "
[[ "$DOKKU_RM_CONTAINER" ]] && DOKKU_RUN_OPTS="--rm"
has_tty && DOKKU_RUN_OPTS+=" -i -t"
is_image_herokuish_based "$IMAGE" && EXEC_CMD="/exec"
docker run $DOKKU_GLOBAL_RUN_ARGS $DOKKU_RUN_OPTS $DOCKER_ARGS $IMAGE $EXEC_CMD "$@"
;;
url | urls)
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
APP="$2"; verify_app_name "$2"
eval "$(config_export app $APP)"
if [[ -s "$DOKKU_ROOT/$APP/URLS" ]]; then
case "$1" in
url)
grep "^http" "$DOKKU_ROOT/$APP/URLS" | head -1
;;
urls)
grep "^http" "$DOKKU_ROOT/$APP/URLS"
;;
esac
exit 0
fi
SCHEME="http"; SSL="$DOKKU_ROOT/$APP/tls"; WILDCARD_SSL="$DOKKU_ROOT/tls"
if [[ -e "$SSL/server.crt" && -e "$SSL/server.key" ]] || [[ -e "$WILDCARD_SSL/server.crt" && -e "$WILDCARD_SSL/server.key" ]]; then
SCHEME="https"
fi
if [[ "$(is_app_vhost_enabled $APP)" == "false" ]]; then
shopt -s nullglob
for PORT_FILE in $DOKKU_ROOT/$APP/PORT.*; do
echo "http://$(< "$DOKKU_ROOT/HOSTNAME"):$(< "$PORT_FILE") (container)"
done
shopt -u nullglob
DOKKU_NGINX_PORT=$(config_get $APP DOKKU_NGINX_PORT || true)
DOKKU_NGINX_SSL_PORT=$(config_get $APP DOKKU_NGINX_SSL_PORT || true)
if [[ -n "$DOKKU_NGINX_PORT" ]]; then
echo "http://$(< "$DOKKU_ROOT/HOSTNAME"):$DOKKU_NGINX_PORT (nginx)"
fi
if [[ -n "$DOKKU_NGINX_SSL_PORT" ]]; then
echo "https://$(< "$DOKKU_ROOT/HOSTNAME"):$DOKKU_NGINX_SSL_PORT (nginx-ssl)"
fi
else
echo "$SCHEME://$(< "$DOKKU_ROOT/VHOST")"
fi
;;
report)
dokku_log_info1 "uname: $(uname -a)"
dokku_log_info1 "memory: "
free -m
dokku_log_info1 "docker version: "
docker version
dokku_log_info1 "docker daemon info: "
docker -D info
dokku_log_info1 "herokuish version: "
docker run --rm -ti gliderlabs/herokuish:latest herokuish version
dokku_log_info1 "dokku version: $(dokku version)"
dokku_log_info1 "dokku plugins: "
dokku plugin
;;
version)
cat "$DOKKU_ROOT/VERSION" || dokku_log_fail "Unable to determine dokku's version"
;;
help)
cat<<EOF
ls, Pretty listing of deployed applications and containers
help|ls:help|run:help|trace:help|url:help|urls:help|version:help)
[[ $(echo "$1" | sed '/.*:help/!d') ]] && help_topic="${1%\:help}"
help_content_func () {
declare desc="return standard plugin help content"
cat<<help_content
ls , Pretty listing of deployed applications and containers
run <app> <cmd>, Run a command in the environment of an application
trace [on/off], Enable dokku tracing
url <app>, Show the first URL for an application (compatibility)
urls <app>, Show all URLs for an application
version, Print dokku's version
EOF
version , Print dokku's version
help , Print the list of commands
help_content
}
if [[ $help_topic ]] ; then
help_content_func | sed "/^\s*$help_topic\s/!d" | sort | sed '/^.*:/d' | column -c2 -t -s,
else
help_content_func
fi
;;
*)
exit $DOKKU_NOT_IMPLEMENTED_EXIT
exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
;;
esac

View File

@@ -0,0 +1,80 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/config/functions"
get_phase_script() {
declare desc="extracts app.json from app image and returns the appropriate json key/value"
local IMAGE="$1"; local PHASE_SCRIPT_KEY="$2"
local GET_PHASE_SCRIPT_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku_get_phase_script.XXXX")
local APP_JSON_FILE="$GET_PHASE_SCRIPT_TMP_WORK_DIR/app.json"
trap 'rm -rf "$GET_PHASE_SCRIPT_TMP_WORK_DIR" > /dev/null' RETURN INT TERM
copy_from_image "$IMAGE" "/app/app.json" "$GET_PHASE_SCRIPT_TMP_WORK_DIR" 2>/dev/null || true
if [[ -f "$APP_JSON_FILE" ]];then
local VALUE=$(get_json_value "scripts.dokku.${PHASE_SCRIPT_KEY}" < "$APP_JSON_FILE")
else
return 0
fi
echo "$VALUE"
}
execute_script() {
declare desc="executes appropriate phase script key from app.json"
local APP="$1"; local IMAGE_TAG="$2"; local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG")
local PHASE_SCRIPT_KEY="$3"
local SCRIPT_CMD=$(get_phase_script "$IMAGE" "$PHASE_SCRIPT_KEY" 2>/dev/null)
if [[ -n "$SCRIPT_CMD" ]];then
dokku_log_info1 "Running '$SCRIPT_CMD' in app container"
local COMMAND
COMMAND="set -eo pipefail; [[ \$DOKKU_TRACE ]] && set -x ; "
COMMAND+=" if [[ -d '/app' ]]; then "
COMMAND+=" export HOME=/app ; "
COMMAND+=" cd \$HOME ; "
COMMAND+=" fi ; "
COMMAND+=" if [[ -d '/app/.profile.d' ]]; then "
COMMAND+=" for file in /app/.profile.d/*; do source \$file; done ; "
COMMAND+=" fi ; "
COMMAND+=" if [[ -d '/cache' ]]; then "
COMMAND+=" echo restoring installation cache... ; "
COMMAND+=" rm -rf /tmp/cache ; "
COMMAND+=" ln -sf /cache /tmp/cache ; "
COMMAND+=" fi ; "
COMMAND+=" $SCRIPT_CMD ;"
COMMAND+=" if [[ -d '/cache' ]]; then "
COMMAND+=" echo removing installation cache... ; "
COMMAND+=" rm -f /tmp/cache ; "
COMMAND+=" fi "
local CACHE_DIR="$DOKKU_ROOT/$APP/cache"
local DOCKER_ARGS=$(: | plugn trigger docker-args-deploy "$APP" "$IMAGE_TAG")
# strip --restart args from DOCKER_ARGS
local DOCKER_ARGS=$(sed -e "s/--restart=[[:graph:]]\+[[:blank:]]\?//g" <<< "$DOCKER_ARGS")
# shellcheck disable=SC2086
local id=$(docker run "$DOKKU_GLOBAL_RUN_ARGS" -e DOKKU_TRACE="$DOKKU_TRACE" --label=dokku_phase_script="${PHASE_SCRIPT_KEY}" -d -v "$CACHE_DIR:/cache" $DOCKER_ARGS "$IMAGE" /bin/bash -c "$COMMAND")
if test "$(docker wait "$id")" -eq 0; then
dokku_container_log_verbose_quiet "$id"
if [[ "$PHASE_SCRIPT_KEY" != "postdeploy" ]];then
if ! is_image_herokuish_based "$IMAGE"; then
local DOKKU_DOCKERFILE_ENTRYPOINT=$(config_get "$APP" DOKKU_DOCKERFILE_ENTRYPOINT)
local DOKKU_DOCKERFILE_CMD=$(config_get "$APP" DOKKU_DOCKERFILE_CMD)
[[ -z "$DOKKU_DOCKERFILE_ENTRYPOINT" ]] && DOKKU_DOCKERFILE_ENTRYPOINT="$(get_entrypoint_from_image "$IMAGE")"
[[ -z "$DOKKU_DOCKERFILE_CMD" ]] && DOKKU_DOCKERFILE_CMD="$(get_cmd_from_image "$IMAGE")"
[[ -n "$DOKKU_DOCKERFILE_ENTRYPOINT" ]] && local DOCKER_COMMIT_ENTRYPOINT_CHANGE_ARG="--change='$DOKKU_DOCKERFILE_ENTRYPOINT'"
[[ -n "$DOKKU_DOCKERFILE_CMD" ]] && local DOCKER_COMMIT_CMD_CHANGE_ARG="--change='$DOKKU_DOCKERFILE_CMD'"
local DOCKER_COMMIT_ARGS="$DOCKER_COMMIT_ENTRYPOINT_CHANGE_ARG $DOCKER_COMMIT_CMD_CHANGE_ARG"
fi
# shellcheck disable=SC2086
eval docker commit $DOCKER_COMMIT_ARGS "$id" "$IMAGE" > /dev/null
fi
else
dokku_container_log_verbose_quiet "$id"
dokku_log_fail "execution of '$SCRIPT_CMD' failed!"
fi
fi
}

View File

@@ -2,13 +2,15 @@
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
if [[ ! -f "$DOKKU_ROOT/HOSTNAME" ]]; then
hostname -f > $DOKKU_ROOT/HOSTNAME
hostname -f > "$DOKKU_ROOT/HOSTNAME"
fi
if [[ ! -f "$DOKKU_ROOT/VHOST" ]]; then
[[ $(dig +short "$(< "$DOKKU_ROOT/HOSTNAME")") ]] && cp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/VHOST"
fi
dokku_path=$(which dokku)
# temporary hack for https://github.com/dokku/dokku/issues/82
# redeploys all apps after a reboot
if [[ $(/sbin/init --version 2> /dev/null) =~ upstart ]]; then
@@ -19,7 +21,7 @@ start on filesystem and started docker
script
sleep 2 # give docker some time
sudo -i -u dokku /usr/local/bin/dokku ps:restore
sudo -i -u dokku $dokku_path ps:restore
end script
EOF
fi
@@ -33,7 +35,7 @@ After=docker.target
[Service]
Type=simple
User=dokku
ExecStart=/usr/local/bin/dokku ps:restore
ExecStart=$dokku_path ps:restore
[Install]
WantedBy=multi-user.target
@@ -57,3 +59,9 @@ if [ ! -f "/home/dokku/HOSTNAME" ]; then
fi
EOF
chmod +x /etc/update-motd.d/99-dokku
chown dokku:dokku "$DOKKU_ROOT/HOSTNAME"
if [[ -f "$DOKKU_ROOT/VHOST" ]]; then
chown dokku:dokku "$DOKKU_ROOT/VHOST"
fi

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core standard plugin"
version = "0.4.0"
version = "0.6.2"
[plugin.config]

View File

@@ -0,0 +1,34 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_CORE_AVAILABLE_PATH/00_dokku-standard/exec-app-json-scripts"
exec_app_json_scripts() {
declare desc="core app.json scripts execution"
local trigger="pre-deploy app_json_scripts"
local APP="$1"; local IMAGE_TAG="$4"; local PHASE_SCRIPT_KEY="postdeploy"
dokku_log_info1 "Attempting to run scripts.dokku.$PHASE_SCRIPT_KEY from app.json (if defined)"
execute_script "$APP" "$IMAGE_TAG" "$PHASE_SCRIPT_KEY"
}
cleanup_container_state() {
declare desc="core post-deploy state cleanup"
local trigger="post-deploy cleanup_container_state"
local APP="$1"; local PROCTYPES="$(egrep -v "^#" "$DOKKU_ROOT/$APP/DOKKU_SCALE" | awk -F '=' '{ print $1 }' | xargs)"
local CONTAINER_FILES="$(find "$DOKKU_ROOT/$APP" -maxdepth 1 -name "CONTAINER.*" -printf "%f\n" | sort -t . -k 3 -n | xargs)"
local CONTAINER_FILE
for CONTAINER_FILE in $CONTAINER_FILES; do
local CONTAINER_TYPE="$(awk -F '.' '{ print $2 }' <<< "$CONTAINER_FILE")"
if [[ "$(is_val_in_list "$CONTAINER_TYPE" "$PROCTYPES" " ")" == "false" ]]; then
dokku_log_info1 "Container type ($CONTAINER_TYPE) is no longer defined. Removing state"
local IP_FILE="${CONTAINER_FILE//CONTAINER/IP}"
local PORT_FILE="${CONTAINER_FILE//CONTAINER/PORT}"
rm -f "$DOKKU_ROOT/$APP/$CONTAINER_FILE" "$DOKKU_ROOT/$APP/$IP_FILE" "$DOKKU_ROOT/$APP/$PORT_FILE"
fi
done
}
exec_app_json_scripts "$@"
cleanup_container_state "$@"

View File

@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_CORE_AVAILABLE_PATH/00_dokku-standard/exec-app-json-scripts"
exec_app_json_scripts() {
declare desc="core app.json scripts execution"
local trigger="pre-deploy app_json_scripts"
local APP="$1"; local IMAGE_TAG="$2"; local PHASE_SCRIPT_KEY="predeploy"
dokku_log_info1 "Attempting to run scripts.dokku.$PHASE_SCRIPT_KEY from app.json (if defined)"
execute_script "$APP" "$IMAGE_TAG" "$PHASE_SCRIPT_KEY"
}
exec_app_json_scripts "$@"

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
dokku_cleanup_cmd(){
declare desc="cleans up old deployment cruft"
local cmd="cleanup"
docker_cleanup
}
dokku_cleanup_cmd "$@"

View File

@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
shift 1
dokku_deploy_cmd "$@"

View File

@@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
dokku_ls_cmd() {
declare desc="lists installed apps with status"
local cmd="ls"
local installed_apps=$(dokku_apps)
local dokku_app
dokku_col_log_info1_quiet "App Name" "Container Type" "Container Id" "Status"
for dokku_app in $installed_apps; do
local APP=$(basename "$dokku_app")
local DOKKU_APP_CIDS=$(get_app_container_ids "$APP")
local DOCKER_RUNNING_CONTAINERS=$(docker ps -q --no-trunc)
if [[ -n $DOKKU_APP_CIDS ]]; then
local DOKKU_APP_CID
for DOKKU_APP_CID in $DOKKU_APP_CIDS; do
local DOKKU_APP_CONTAINER_STATUS="stopped"
[[ $DOCKER_RUNNING_CONTAINERS =~ $DOKKU_APP_CID ]] && local DOKKU_APP_CONTAINER_STATUS="running"
local DOKKU_APP_CONTAINER_TYPE=$(grep -l "$DOKKU_APP_CID" "$DOKKU_ROOT/$APP"/CONTAINER.* | awk -F '/' '{ print $5 }' | awk -F '.' '{ print $2 }')
dokku_col_log_msg "$APP" "$DOKKU_APP_CONTAINER_TYPE" "${DOKKU_APP_CID:0:12}" "$DOKKU_APP_CONTAINER_STATUS"
done
else
dokku_col_log_msg "$APP" "NOT_DEPLOYED" "NOT_DEPLOYED" "NOT_DEPLOYED"
fi
done
}
dokku_ls_cmd "$@"

View File

@@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
dokku_report_cmd() {
declare desc="reports dokku vitals for troubleshooting"
local cmd="report"
dokku_log_info1 "uname: $(uname -a)"
dokku_log_info1 "memory: "
free -m
dokku_log_info1 "docker version: "
docker version
dokku_log_info1 "docker daemon info: "
docker -D info
dokku_log_info1 "sigil version: $(sigil -v)"
dokku_log_info1 "herokuish version: "
docker run --rm -ti gliderlabs/herokuish:latest herokuish version
dokku_log_info1 "dokku version: $(dokku version)"
dokku_log_info1 "dokku plugins: "
dokku plugin
}
dokku_report_cmd "$@"

View File

@@ -0,0 +1,50 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_CORE_AVAILABLE_PATH/ps/functions"
source "$PLUGIN_AVAILABLE_PATH/config/functions"
dokku_run_cmd() {
declare desc="runs command in container based on app image"
local cmd="run"
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
local APP="$2"; local IMAGE_TAG=$(get_running_image_tag "$APP"); local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG")
verify_app_name "$APP"
shift 2
if [[ -z "$DOKKU_RM_CONTAINER" ]]; then
local DOKKU_APP_RM_CONTAINER=$(config_get "$APP" DOKKU_RM_CONTAINER || true)
local DOKKU_GLOBAL_RM_CONTAINER=$(config_get --global DOKKU_RM_CONTAINER || true)
local DOKKU_RM_CONTAINER=${DOKKU_APP_RM_CONTAINER:="$DOKKU_GLOBAL_RM_CONTAINER"}
fi
local DOCKER_ARGS=$(: | plugn trigger docker-args-run "$APP" "$IMAGE_TAG")
[[ "$DOKKU_TRACE" ]] && local DOCKER_ARGS+=" -e TRACE=true "
local DOKKU_RUN_OPTS=""
if [[ "$DOKKU_RM_CONTAINER" ]]; then
DOKKU_RUN_OPTS+=" --rm"
elif [[ "$DOKKU_DETACH_CONTAINER" ]]; then
DOKKU_RUN_OPTS+=" --detach"
fi
has_tty && DOKKU_RUN_OPTS+=" -i -t"
is_image_herokuish_based "$IMAGE" && local EXEC_CMD="/exec"
DOKKU_QUIET_OUTPUT=1 extract_procfile "$APP"
POTENTIAL_PROCFILE_KEY="$1"
PROC_CMD=$(get_cmd_from_procfile "$APP" "$POTENTIAL_PROCFILE_KEY" || echo '')
remove_procfile "$APP"
if [ ! -z "$PROC_CMD" ]; then
dokku_log_info1 "Found '$POTENTIAL_PROCFILE_KEY' in Procfile, running that command"
set -- "$PROC_CMD" "${@:2}"
fi
# shellcheck disable=SC2086
docker run $DOKKU_GLOBAL_RUN_ARGS $DOKKU_RUN_OPTS $DOCKER_ARGS $IMAGE $EXEC_CMD "$@"
}
dokku_run_cmd "$@"

View File

@@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
dokku_trace_cmd() {
declare desc="enables/disables DOKKU_TRACE"
local cmd="trace"
[[ -d $DOKKU_ROOT/.dokkurc ]] || mkdir -p "$DOKKU_ROOT/.dokkurc"
[[ "$2" == "on" ]] || [[ "$2" == "off" ]] || {
dokku_log_fail "Valid trace options are [on/off]"
}
if [[ "$2" == "on" ]]; then
echo "Enabling dokku trace"
echo "export DOKKU_TRACE=1" > "$DOKKU_ROOT/.dokkurc/DOKKU_TRACE"
fi
if [[ "$2" == "off" ]]; then
echo "Disabling dokku trace"
rm -f "$DOKKU_ROOT/.dokkurc/DOKKU_TRACE"
fi
}
dokku_trace_cmd "$@"

View File

@@ -0,0 +1 @@
urls

View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
dokku_urls_cmd() {
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
local APP="$2"
get_app_urls "$@"
}
dokku_urls_cmd "$@"

View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
dokku_version_cmd() {
declare desc="prints dokku version"
local cmd="version"
cat "$DOKKU_ROOT/VERSION" || dokku_log_fail "Unable to determine dokku's version"
}
dokku_version_cmd "$@"

View File

@@ -1,54 +1,33 @@
#!/usr/bin/env bash
[[ " events events:on events:off events:list help events:help " == *" $1 "* ]] || exit $DOKKU_NOT_IMPLEMENTED_EXIT
[[ " help events:help " == *" $1 "* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
case "$1" in
events)
if [[ -f $DOKKU_EVENTS_LOGFILE ]]; then
if [[ $2 == "-t" ]]; then
tail -F $DOKKU_EVENTS_LOGFILE
else
tail -n 100 $DOKKU_EVENTS_LOGFILE
fi
fi
;;
events:on)
echo "Enabling dokku events logger"
[[ -d $DOKKU_ROOT/.dokkurc ]] || mkdir -p $DOKKU_ROOT/.dokkurc
echo "export DOKKU_EVENTS=1" > $DOKKU_ROOT/.dokkurc/DOKKU_EVENTS
;;
events:off)
echo "Disabling dokku events logger"
rm -f $DOKKU_ROOT/.dokkurc/DOKKU_EVENTS
;;
events:list)
PLUGIN_DIR="$(dirname $0)"
if [[ "$DOKKU_EVENTS" ]]; then
logged="$(find $PLUGIN_DIR -type l -printf '%f ' | sort)"
dokku_col_log_info2_quiet "Events currently logged"
for hook in $logged; do
dokku_col_log_msg "$hook"
done
else
dokku_log_warn "Events logger disabled"
fi
;;
help | events:help)
cat && cat<<EOF
help_content_func () {
declare desc="return events plugin help content"
cat<<help_content
events [-t], Show the last events (-t follows)
events:list, List logged events
events:on, Enable events logger
events:off, Disable events logger
EOF
help_content
}
if [[ $1 = "events:help" ]] ; then
echo 'Usage: dokku events:COMMAND [-t]'
echo ''
echo 'Interact with Dokku event logger.'
echo ''
echo 'Additional commands:'
help_content_func | sort | column -c2 -t -s,
else
help_content_func
fi
;;
*)
exit $DOKKU_NOT_IMPLEMENTED_EXIT
exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
;;
esac

View File

@@ -2,4 +2,4 @@
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
[[ ! "$DOKKU_EVENTS" ]] || dokku_log_plugn_trigger_call "$(basename $0)" "$@"
[[ ! "$DOKKU_EVENTS" ]] || dokku_log_plugn_trigger_call "$(basename "$0")" "$@"

View File

@@ -2,7 +2,8 @@
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
DOKKU_RSYSLOG_FILTER=/etc/rsyslog.d/99-dokku.conf
DOKKU_RSYSLOG_FILTER_DIR=/etc/rsyslog.d
DOKKU_RSYSLOG_FILTER=$DOKKU_RSYSLOG_FILTER_DIR/99-dokku.conf
DOKKU_LOGROTATE_FILE=/etc/logrotate.d/dokku
flag_rsyslog_needs_restart=n
@@ -11,7 +12,7 @@ flag_rsyslog_needs_restart=n
# exits gracefully if the path already exists
mkdir -m 775 -p "$DOKKU_LOGS_DIR"
case "$DOKKU_DISTRO" in
debian)
arch|debian)
chgrp dokku "$DOKKU_LOGS_DIR"
;;
*)
@@ -22,7 +23,7 @@ esac
if [[ ! -f "$DOKKU_EVENTS_LOGFILE" ]]; then
touch "$DOKKU_EVENTS_LOGFILE"
case "$DOKKU_DISTRO" in
debian)
arch|debian)
chgrp dokku "$DOKKU_EVENTS_LOGFILE"
;;
*)
@@ -33,7 +34,7 @@ if [[ ! -f "$DOKKU_EVENTS_LOGFILE" ]]; then
chmod 664 "$DOKKU_EVENTS_LOGFILE"
fi
if [[ ! -f "$DOKKU_RSYSLOG_FILTER" ]]; then
if [[ -d "$DOKKU_RSYSLOG_FILTER_DIR" && ! -f "$DOKKU_RSYSLOG_FILTER" ]]; then
cat >"$DOKKU_RSYSLOG_FILTER" <<EOF
:syslogtag, contains, "dokku" $DOKKU_EVENTS_LOGFILE
EOF
@@ -56,13 +57,18 @@ $DOKKU_LOGS_DIR/*.log {
create 664 syslog dokku
}
EOF
if [[ "$DOKKU_DISTRO" = "debian" ]]; then
sed -i '/\s*su syslog dokku/d; s/\(create [0-7][0-7][0-7]\) syslog dokku/\1 root dokku/g' $DOKKU_LOGROTATE_FILE
fi
flag_rsyslog_needs_restart=y
fi
if [[ "$flag_rsyslog_needs_restart" == "y" ]]; then
if [[ -f "$DOKKU_RSYSLOG_FILTER" && "$flag_rsyslog_needs_restart" == "y" ]]; then
service rsyslog restart
fi
[[ ! "$DOKKU_EVENTS" ]] || dokku_log_plugn_trigger_call "$(basename $0)" "$@"
[[ ! "$DOKKU_EVENTS" ]] || dokku_log_plugn_trigger_call "$(basename "$0")" "$@"
exit 0

Some files were not shown because too many files have changed in this diff Show More