Compare commits
312 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa74315389 | ||
|
|
b7bb766f53 | ||
|
|
ae972cf3cd | ||
|
|
b20a91d24f | ||
|
|
bd8ca6ca5c | ||
|
|
6543f5d11c | ||
|
|
f0000a18ba | ||
|
|
80d13234f9 | ||
|
|
f6c1ad1b8f | ||
|
|
2f5fce36e4 | ||
|
|
8d14d15acc | ||
|
|
3cc1b42160 | ||
|
|
2a76f7c3b3 | ||
|
|
2b019aef2f | ||
|
|
7dc6d449bd | ||
|
|
a7ec68e107 | ||
|
|
3192f9b724 | ||
|
|
3decb4e780 | ||
|
|
a1ae7d76f4 | ||
|
|
47dfde16f5 | ||
|
|
99632b7141 | ||
|
|
424827d813 | ||
|
|
b7d1f54bd5 | ||
|
|
bc93e5da17 | ||
|
|
71a8142ed9 | ||
|
|
688cb910dd | ||
|
|
d3b4c49d17 | ||
|
|
25422a4a2a | ||
|
|
62143b1fa1 | ||
|
|
a522adfecb | ||
|
|
83f4df3017 | ||
|
|
3df37bcc99 | ||
|
|
4b0163103e | ||
|
|
bd7deae883 | ||
|
|
d4cf23ec07 | ||
|
|
bdd2b4bfe5 | ||
|
|
ecd47dcdeb | ||
|
|
3762b7b9f9 | ||
|
|
98ef078d33 | ||
|
|
a79cd7aebf | ||
|
|
aa345fad01 | ||
|
|
ed06b8961e | ||
|
|
8e2a3783ce | ||
|
|
d9ab4d1424 | ||
|
|
833db67f25 | ||
|
|
01f370ab82 | ||
|
|
9d4a288579 | ||
|
|
b6f9672d40 | ||
|
|
8f8ee9c5da | ||
|
|
9effe275bd | ||
|
|
c1ae280a78 | ||
|
|
ce3aa4b93e | ||
|
|
fcefd4a29b | ||
|
|
4f8c1b64c9 | ||
|
|
2ece0e1bf8 | ||
|
|
1216a5e65a | ||
|
|
aca2540651 | ||
|
|
2cb20f3fd0 | ||
|
|
946756bd43 | ||
|
|
d74006b51a | ||
|
|
e6dfdc0732 | ||
|
|
21d0859253 | ||
|
|
2b19881f01 | ||
|
|
39375342e0 | ||
|
|
ab94a9fc67 | ||
|
|
ff18e0d6be | ||
|
|
6c1d6225f9 | ||
|
|
99c56ccd6d | ||
|
|
f99aa2b128 | ||
|
|
a43fc39d9a | ||
|
|
6be1fd33cd | ||
|
|
5e9df3a92d | ||
|
|
5c741696fc | ||
|
|
8e30722c1e | ||
|
|
cd48505922 | ||
|
|
24cab65d9c | ||
|
|
dc8acc0da6 | ||
|
|
0297dd9e1f | ||
|
|
e4268148cf | ||
|
|
f226dc7c27 | ||
|
|
b71c5b668f | ||
|
|
30ae651a59 | ||
|
|
d2ee0994c0 | ||
|
|
1e5a8b146c | ||
|
|
6bf9ef0aa5 | ||
|
|
100afca1ca | ||
|
|
9a29cc59a8 | ||
|
|
6c08b9b343 | ||
|
|
48965e05bd | ||
|
|
2c1f32199a | ||
|
|
1e0c585b74 | ||
|
|
0c58aeaa52 | ||
|
|
2cedc19b2a | ||
|
|
9bb554e5bc | ||
|
|
4aab4dcfcf | ||
|
|
d4660d9fe9 | ||
|
|
9a7d4fb402 | ||
|
|
d302316549 | ||
|
|
327db3d07a | ||
|
|
1cba46f3a1 | ||
|
|
54c5d0dfa6 | ||
|
|
ef59ff38f6 | ||
|
|
683113ef78 | ||
|
|
79a7342808 | ||
|
|
eab69bd6d5 | ||
|
|
b1deb45c81 | ||
|
|
5ff73995f2 | ||
|
|
e0f6435d86 | ||
|
|
2565ea1543 | ||
|
|
cb8a9648c9 | ||
|
|
17f7708226 | ||
|
|
166f7f38e4 | ||
|
|
74e861417e | ||
|
|
0487083f37 | ||
|
|
3c6982a942 | ||
|
|
6760a2d143 | ||
|
|
a9fd2cdbf6 | ||
|
|
377412f9f8 | ||
|
|
848f92ef7f | ||
|
|
8bbb210a10 | ||
|
|
401a42f5c4 | ||
|
|
5a99b8f0ed | ||
|
|
346efbfdd8 | ||
|
|
498f0eda22 | ||
|
|
c268432bc3 | ||
|
|
a833688355 | ||
|
|
4917330b79 | ||
|
|
4d91b2085e | ||
|
|
29c69f9f86 | ||
|
|
476429a7db | ||
|
|
2d045d1ae1 | ||
|
|
9bd0c69dac | ||
|
|
b232f7cd49 | ||
|
|
904dfb64aa | ||
|
|
a5ef53f2f5 | ||
|
|
88db4daa62 | ||
|
|
56dde3ff31 | ||
|
|
2da58ff351 | ||
|
|
af48605054 | ||
|
|
66790e3d82 | ||
|
|
2c201a7d6f | ||
|
|
78d2b3e7d2 | ||
|
|
9b60f0c3c6 | ||
|
|
668437a9e5 | ||
|
|
5f30115796 | ||
|
|
5c6e39d2c0 | ||
|
|
6a9d9f212f | ||
|
|
599bd59c6f | ||
|
|
e4dd40bbcc | ||
|
|
325b9258e4 | ||
|
|
8cef6b2074 | ||
|
|
fe00835aa7 | ||
|
|
ad0d2b1f6d | ||
|
|
c27b0c08ed | ||
|
|
c73094615e | ||
|
|
989ea72490 | ||
|
|
d9e1548683 | ||
|
|
e474d49320 | ||
|
|
e4d916c308 | ||
|
|
e30c01c234 | ||
|
|
9ae9c7ad11 | ||
|
|
ea240f117e | ||
|
|
68fb0e7b98 | ||
|
|
9d74f1ecf2 | ||
|
|
2356dbd594 | ||
|
|
7aa48d3426 | ||
|
|
b8b4f6fedf | ||
|
|
25a2801cb1 | ||
|
|
86ef6ae5d1 | ||
|
|
4e99078ac1 | ||
|
|
7de160b64d | ||
|
|
99030a110c | ||
|
|
ee18909935 | ||
|
|
4f621916a7 | ||
|
|
f89f946c40 | ||
|
|
8e34477c96 | ||
|
|
5940e43c85 | ||
|
|
c1c76362e7 | ||
|
|
a034ec9803 | ||
|
|
2da4f5ef03 | ||
|
|
d7386317fc | ||
|
|
851ca592d5 | ||
|
|
9d584ed145 | ||
|
|
ac1c4dc571 | ||
|
|
32505b14e7 | ||
|
|
1bcd76ffe9 | ||
|
|
565cd5c0e8 | ||
|
|
8597b692ee | ||
|
|
e9447a26d9 | ||
|
|
17a602efe8 | ||
|
|
7b1bc522f6 | ||
|
|
64f83f976e | ||
|
|
cb9efa3322 | ||
|
|
28f83ab0d5 | ||
|
|
be13b0149a | ||
|
|
e73c89abc8 | ||
|
|
7a36ecf196 | ||
|
|
33dd90a091 | ||
|
|
c67a4dcc7d | ||
|
|
546551e6e9 | ||
|
|
bd4aee0864 | ||
|
|
06d18b4cbd | ||
|
|
075de78442 | ||
|
|
3cead25acf | ||
|
|
559347f985 | ||
|
|
613679352b | ||
|
|
d6c7682068 | ||
|
|
4cd847fb27 | ||
|
|
58e3556e0e | ||
|
|
500a6dd73b | ||
|
|
7d3571757d | ||
|
|
26ee0d7ae2 | ||
|
|
13f7727fe3 | ||
|
|
8a14b34446 | ||
|
|
6a39fd70e1 | ||
|
|
fff050c71d | ||
|
|
61327620da | ||
|
|
80cc57caa0 | ||
|
|
55f38414d1 | ||
|
|
96da38a8e4 | ||
|
|
25b144e496 | ||
|
|
478f5e34d3 | ||
|
|
47dfa921cd | ||
|
|
c162f57dbd | ||
|
|
92073eda12 | ||
|
|
bb9b36b291 | ||
|
|
8b93d9bf54 | ||
|
|
d7566daacc | ||
|
|
7b8cefbadc | ||
|
|
579ffa5a62 | ||
|
|
c6fa061604 | ||
|
|
fd811b020a | ||
|
|
9ae2ab105b | ||
|
|
1a94a62fe3 | ||
|
|
a13a0df35e | ||
|
|
f6bdd948b1 | ||
|
|
1ceee12fc4 | ||
|
|
dbacfed855 | ||
|
|
3ac21ae9a3 | ||
|
|
7985e93e29 | ||
|
|
4230e816df | ||
|
|
ae3aae9af8 | ||
|
|
67d7a64a51 | ||
|
|
cdc327b777 | ||
|
|
3c9a1d488b | ||
|
|
72d46ba64b | ||
|
|
d9feca5606 | ||
|
|
f29f4294c7 | ||
|
|
db94fcb6b4 | ||
|
|
4945bd79ca | ||
|
|
22d053c9d0 | ||
|
|
6482ae164c | ||
|
|
7900a2e97e | ||
|
|
95993955c5 | ||
|
|
6b48b250a7 | ||
|
|
66ad41f814 | ||
|
|
a36d35d752 | ||
|
|
89d1a9751c | ||
|
|
841c8c22d7 | ||
|
|
cb9d98a819 | ||
|
|
a62bae8c7c | ||
|
|
344a63b956 | ||
|
|
0ea44cfafb | ||
|
|
1948a41949 | ||
|
|
50e928b685 | ||
|
|
7352cd05c5 | ||
|
|
94980c8394 | ||
|
|
ba66a42891 | ||
|
|
1ec1a6cd7d | ||
|
|
58eb6f3c54 | ||
|
|
78e106cff2 | ||
|
|
1cf82a6020 | ||
|
|
7938bd08ae | ||
|
|
20312ffa4b | ||
|
|
539b765e21 | ||
|
|
36edeb2401 | ||
|
|
58af2417e2 | ||
|
|
5fc97e9553 | ||
|
|
3e868a41e9 | ||
|
|
2e7dde73ab | ||
|
|
c72d337f69 | ||
|
|
a8c1b728d2 | ||
|
|
f328a9940b | ||
|
|
1ef5b92910 | ||
|
|
1dd07aeda9 | ||
|
|
1628f60553 | ||
|
|
970f4489d4 | ||
|
|
997cec4b9b | ||
|
|
127b7a15b5 | ||
|
|
bbf310147e | ||
|
|
858240874c | ||
|
|
7bddd8751e | ||
|
|
0540c254d0 | ||
|
|
6caed369d7 | ||
|
|
9da47d84e0 | ||
|
|
6450f9332a | ||
|
|
722564b2da | ||
|
|
a93e180a89 | ||
|
|
8cbc36fd22 | ||
|
|
8d84721882 | ||
|
|
c739c770f7 | ||
|
|
d01961424d | ||
|
|
e114ab3f20 | ||
|
|
ebd185a798 | ||
|
|
eb4e5957cd | ||
|
|
429eb4af83 | ||
|
|
fb88783f9d | ||
|
|
aa2f02b1d2 | ||
|
|
f073ebe4cd | ||
|
|
5bc3e14eb4 | ||
|
|
6548cc4477 | ||
|
|
e64daa18cf |
@@ -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.
|
||||
|
||||
240
HISTORY.md
@@ -1,5 +1,245 @@
|
||||
# History
|
||||
|
||||
## 0.6.4
|
||||
|
||||
Included in this release are a couple of bug fixes for existing features.
|
||||
|
||||
Thanks to all the contributors who helped with this release!
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #2275: @sseemayer Prefer file import in certs:add if files given
|
||||
- #2279: @michaelshobbs Only attempt to stop a checks-disabled container if it is actually running
|
||||
|
||||
### New Features
|
||||
|
||||
- #2270: @guillaumewuip Allow apps:destroy when not in a project
|
||||
- #2271: @josegonzalez Handle purging the dokku user, group, and logs directory during `apt-get purge`
|
||||
|
||||
### Documentation
|
||||
|
||||
- #2272: @josegonzalez Add documentation surrounding when the /app/.env file is populated
|
||||
|
||||
## 0.6.3
|
||||
|
||||
This release is mostly a documentation release.
|
||||
|
||||
Thanks to all the contributors who helped with this release!
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- #2258: @michaelshobbs Support domains that start with digits per RFC1123
|
||||
|
||||
### New Features
|
||||
|
||||
- #2260: @josegonzalez Add ability to remove a specific port mapping tuple
|
||||
- #2261: @josegonzalez Drop apparmor requirement to support systemd systems
|
||||
|
||||
### Documentation
|
||||
|
||||
- #2262: @josegonzalez Document that REV is optional in the receive-app trigger
|
||||
- #2264: @troy Use Markdown for sponsors page, so it's clickable from GitHub
|
||||
- #2266: @michaelshobbs Add documentation surrounding proxy port mapping
|
||||
|
||||
## 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.
|
||||
|
||||
@@ -15,11 +15,11 @@ Output of the following commands
|
||||
(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:
|
||||
- If a deploy is failing or behaving unexpectedly:
|
||||
- Application name
|
||||
- The type of application being deployed (node, php, python, ruby, etc.)
|
||||
- Whether or not you have a `Dockerfile` in the root of your repository
|
||||
- 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):
|
||||
|
||||
6
Makefile
@@ -1,6 +1,6 @@
|
||||
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
|
||||
@@ -62,10 +62,10 @@ copyfiles:
|
||||
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
|
||||
|
||||
82
README.md
@@ -1,6 +1,9 @@
|
||||
# Dokku [](https://circleci.com/gh/dokku/dokku/tree/master) [](https://packagecloud.io/dokku/dokku) [](https://webchat.freenode.net/?channels=dokku) [](https://glider-slackin.herokuapp.com/) [](http://dokku.viewdocs.io/dokku/) [](https://gratipay.com/dokku/)
|
||||
# Dokku [](https://circleci.com/gh/dokku/dokku/tree/master) [](https://packagecloud.io/dokku/dokku) [](https://webchat.freenode.net/?channels=dokku) [](https://glider-slackin.herokuapp.com/) [](http://dokku.viewdocs.io/dokku/)
|
||||
[](#sponsors)
|
||||
[](#backers)
|
||||
[](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.5.3/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.5.3 bash bootstrap.sh
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.6.4/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.6.4 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
|
||||
|
||||
|
||||
3
SPONSORS.md
Normal file
@@ -0,0 +1,3 @@
|
||||
[Deis](http://deis.io)
|
||||
|
||||
[DigitalOcean](https://www.digitalocean.com/)
|
||||
2
Vagrantfile
vendored
@@ -82,7 +82,7 @@ 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|
|
||||
|
||||
@@ -12,6 +12,7 @@ set -eo pipefail; [[ $TRACE ]] && set -x
|
||||
# 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/"
|
||||
@@ -22,6 +23,12 @@ ensure-environment() {
|
||||
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
|
||||
}
|
||||
|
||||
install-requirements() {
|
||||
@@ -78,7 +85,7 @@ install-dokku-from-source() {
|
||||
|
||||
install-dokku-from-package() {
|
||||
local DOKKU_CHECKOUT="$1"
|
||||
local NO_INSTALL_RECOMMENDS=""
|
||||
local NO_INSTALL_RECOMMENDS=${DOKKU_NO_INSTALL_RECOMMENDS:=""}
|
||||
|
||||
if [[ -n $DOKKU_DOCKERFILE ]]; then
|
||||
NO_INSTALL_RECOMMENDS=" --no-install-recommends "
|
||||
|
||||
@@ -11,6 +11,8 @@ dependencies:
|
||||
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:
|
||||
|
||||
@@ -9,7 +9,7 @@ import subprocess
|
||||
import sys
|
||||
import threading
|
||||
|
||||
VERSION = 'v0.5.3'
|
||||
VERSION = 'v0.6.4'
|
||||
|
||||
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=())
|
||||
|
||||
@@ -33,6 +33,14 @@ client_help_msg() {
|
||||
exit 20 # exit with specific status. only used in units tests for now
|
||||
}
|
||||
|
||||
is_git_repo() {
|
||||
git rev-parse &>/dev/null
|
||||
}
|
||||
|
||||
has_dokku_remote() {
|
||||
git remote show | grep dokku
|
||||
}
|
||||
|
||||
if [[ -z $DOKKU_HOST ]]; then
|
||||
if [[ -d .git ]] || git rev-parse --git-dir > /dev/null 2>&1; then
|
||||
DOKKU_HOST=$(git remote -v 2>/dev/null | grep -Ei "^dokku" | head -n 1 | cut -f1 -d' ' | cut -f2 -d '@' | cut -f1 -d':' 2>/dev/null || true)
|
||||
@@ -79,11 +87,9 @@ if [[ ! -z $DOKKU_HOST ]]; then
|
||||
echo "! Dokku remote not added! Do you already have a dokku remote?"
|
||||
return
|
||||
fi
|
||||
git push dokku master
|
||||
return $?
|
||||
;;
|
||||
apps:destroy)
|
||||
git remote remove dokku
|
||||
is_git_repo && has_dokku_remote && git remote remove dokku
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
160
deb.mk
@@ -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.9
|
||||
HEROKUISH_VERSION ?= 0.3.13
|
||||
HEROKUISH_ARCHITECTURE = amd64
|
||||
HEROKUISH_PACKAGE_NAME = herokuish_$(HEROKUISH_VERSION)_$(HEROKUISH_ARCHITECTURE).deb
|
||||
|
||||
@@ -8,28 +8,49 @@ 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
|
||||
|
||||
SIGIL_DESCRIPTION = 'Standalone string interpolator and template processor'
|
||||
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 = sigil_$(SIGIL_VERSION)_$(SIGIL_ARCHITECTURE).deb
|
||||
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
|
||||
|
||||
GOROOT = /usr/local/go
|
||||
GOBIN = /usr/local/go/bin/go
|
||||
GOPATH = /home/vagrant/gocode
|
||||
GOTARBALL = go1.5.3.linux-amd64.tar.gz
|
||||
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
|
||||
|
||||
@@ -47,29 +68,18 @@ install-from-deb:
|
||||
sudo apt-get update -qq > /dev/null
|
||||
sudo DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get install -yy dokku
|
||||
|
||||
golang:
|
||||
ifeq (,$(wildcard /tmp/$(GOTARBALL)))
|
||||
@echo "-> Installing golang"
|
||||
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 mercurial > /dev/null 2>&1
|
||||
sudo wget -nv -O /tmp/$(GOTARBALL) https://storage.googleapis.com/golang/$(GOTARBALL)
|
||||
sudo tar -C /usr/local -xzf /tmp/$(GOTARBALL)
|
||||
endif
|
||||
|
||||
deb-all: deb-herokuish deb-dokku deb-plugn deb-sshcommand deb-sigil
|
||||
deb-all: deb-setup deb-herokuish deb-dokku deb-plugn deb-sshcommand deb-sigil
|
||||
mv /tmp/*.deb .
|
||||
@echo "Done"
|
||||
|
||||
deb-setup:
|
||||
@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 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
|
||||
@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
|
||||
|
||||
@@ -96,19 +106,21 @@ deb-herokuish: deb-setup
|
||||
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
|
||||
@@ -118,61 +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 golang
|
||||
deb-plugn:
|
||||
rm -rf /tmp/tmp /tmp/build $(PLUGN_PACKAGE_NAME)
|
||||
mkdir -p /tmp/tmp /tmp/build /tmp/build/usr/local/bin
|
||||
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"
|
||||
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 -f plugn && go build -o plugn
|
||||
mv /home/vagrant/gocode/src/github.com/dokku/plugn/plugn /tmp/build/usr/local/bin/plugn
|
||||
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' .
|
||||
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 /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"
|
||||
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' .
|
||||
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: deb-setup golang
|
||||
deb-sigil:
|
||||
rm -rf /tmp/tmp /tmp/build $(SIGIL_PACKAGE_NAME)
|
||||
mkdir -p /tmp/tmp /tmp/build /tmp/build/usr/local/bin
|
||||
mkdir -p /tmp/tmp /tmp/build /tmp/build/usr/bin
|
||||
|
||||
@echo "-> Cloning repository"
|
||||
git clone -q -b v$(SIGIL_VERSION) "https://github.com/$(SIGIL_REPO_NAME).git" /tmp/tmp/sigil > /dev/null
|
||||
rm -rf /tmp/tmp/sigil/.git /tmp/tmp/sigil/.gitignore
|
||||
@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"
|
||||
export PATH=$(PATH):$(GOROOT)/bin:$(GOPATH)/bin && export GOROOT=$(GOROOT) && export GOPATH=$(GOPATH):/tmp/tmp/sigil && go get github.com/gliderlabs/sigil
|
||||
export PATH=$(PATH):$(GOROOT)/bin:$(GOPATH)/bin && export GOROOT=$(GOROOT) && export GOPATH=$(GOPATH):/tmp/tmp/sigil && cd /home/vagrant/gocode/src/github.com/gliderlabs/sigil && make deps
|
||||
export PATH=$(PATH):$(GOROOT)/bin:$(GOPATH)/bin && export GOROOT=$(GOROOT) && export GOPATH=$(GOPATH):/tmp/tmp/sigil && cd /home/vagrant/gocode/src/github.com/gliderlabs/sigil && make build
|
||||
cp /home/vagrant/gocode/src/github.com/gliderlabs/sigil/build/Linux/sigil /tmp/build/usr/local/bin/sigil
|
||||
chmod +x /tmp/build/usr/local/bin/sigil
|
||||
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 sigil -v $(SIGIL_VERSION) -a $(SIGIL_ARCHITECTURE) -p $(SIGIL_PACKAGE_NAME) --url "https://github.com/$(SIGIL_REPO_NAME)" --description $(SIGIL_DESCRIPTION) --license 'MIT License' .
|
||||
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
@@ -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
@@ -1,11 +1,12 @@
|
||||
Package: dokku
|
||||
Version: 0.5.3
|
||||
Version: 0.6.4
|
||||
Section: web
|
||||
Priority: optional
|
||||
Architecture: amd64
|
||||
Depends: locales, git, make, curl, gcc, man-db, sshcommand, sigil, docker-engine-cs (>= 1.9.1) | docker-engine (>= 1.9.1), 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, 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
@@ -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
|
||||
32
debian/postinst
vendored
@@ -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
|
||||
@@ -46,6 +65,13 @@ case "$1" in
|
||||
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
|
||||
|
||||
@@ -88,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
|
||||
;;
|
||||
|
||||
16
debian/postrm
vendored
@@ -1,8 +1,14 @@
|
||||
#!/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}"
|
||||
readonly DOKKU_LOGS_DIR="${DOKKU_LOGS_DIR:="/var/log/dokku"}"
|
||||
|
||||
main() {
|
||||
if [[ -f /etc/systemd/system/dokku-installer.conf ]] || [[ -f /etc/init/dokku-installer.conf ]]; then
|
||||
@@ -35,10 +41,12 @@ main() {
|
||||
find ${DOKKU_ROOT} -type d -empty -delete
|
||||
fi
|
||||
|
||||
if [[ -e /usr/share/debconf/confmodule ]]; then
|
||||
. /usr/share/debconf/confmodule
|
||||
db_purge
|
||||
fi
|
||||
rm -rf "${DOKKU_LOGS_DIR}"
|
||||
|
||||
deluser dokku || true
|
||||
delgroup dokku || true
|
||||
|
||||
db_purge
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
5
debian/preinst
vendored
@@ -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)
|
||||
|
||||
@@ -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,6 +48,8 @@ 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).
|
||||
|
||||
Follow the [user management documentation](/dokku/deployment/user-management) in order to add users to dokku.
|
||||
|
||||
@@ -17,6 +17,9 @@
|
||||
- Replaced "magic" `NO_VHOST` variable with `domains:enable/disable`
|
||||
- Simplified zero downtime control
|
||||
- `checks:enable/disable`
|
||||
## Dockerfile apps with multiple ports
|
||||
- Dockerfiles with multiple `EXPOSE` clauses will get all **tcp** ports proxied by default (nginx does not support proxying udp)
|
||||
- UDP can be exposed by disabling the nginx proxy with `dokku proxy:disable myapp`
|
||||
|
||||
## 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`
|
||||
|
||||
32
docs/appendices/0.6.0-migration-guide.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# 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.
|
||||
- Default port mappings
|
||||
- buildpack apps will be set to `http:80:5000` and will also include `https:443:5000` if SSL is enabled.
|
||||
- dockerfile apps with explicitly exposed ports (i.e. using the `EXPOSE` directive) will be configured with a listener on each exposed port that proxies to the same port of the deployed application container.
|
||||
- You may override this behavior with the [`proxy:ports-*` commands](/dokku/proxy/) or by directly setting `DOKKU_PROXY_PORT_MAP` with the `config:set` command
|
||||
- dockerfile apps without explicitly exposed ports will behave the same as a buildpack app
|
||||
- NOTE: These defaults **are not** automatically changed on subsequent pushes and must be manipulated with the aforementioned commands
|
||||
|
||||
## 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
|
||||
@@ -182,11 +182,11 @@ 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.
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
### Adding deploy users
|
||||
## Adding deploy users
|
||||
|
||||
See the [user management documentation](/dokku/deployment/user-management).
|
||||
|
||||
@@ -198,7 +198,7 @@ See the [nginx documentation](/dokku/nginx/#default-site).
|
||||
|
||||
See the [dockerfile documentation](/dokku/deployment/dockerfiles/).
|
||||
|
||||
### Specifying a custom buildpack
|
||||
## Specifying a custom buildpack
|
||||
|
||||
See the [buildpack documentation](/dokku/deployment/buildpacks/).
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
<browserconfig>
|
||||
<msapplication>
|
||||
<tile>
|
||||
<square70x70logo src="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/mstile-70x70.png"/>
|
||||
<square150x150logo src="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/mstile-150x150.png"/>
|
||||
<square310x310logo src="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/mstile-310x310.png"/>
|
||||
<wide310x150logo src="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/mstile-310x150.png"/>
|
||||
<square70x70logo src="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/mstile-70x70.png"/>
|
||||
<square150x150logo src="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/mstile-150x150.png"/>
|
||||
<square310x310logo src="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/mstile-310x310.png"/>
|
||||
<wide310x150logo src="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/mstile-310x150.png"/>
|
||||
<TileColor>#da532c</TileColor>
|
||||
</tile>
|
||||
</msapplication>
|
||||
|
||||
@@ -2,37 +2,37 @@
|
||||
"name": "Dokku",
|
||||
"icons": [
|
||||
{
|
||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.5.3\/docs\/assets\/favicons\/android-chrome-36x36.png",
|
||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.6.4\/docs\/assets\/favicons\/android-chrome-36x36.png",
|
||||
"sizes": "36x36",
|
||||
"type": "image\/png",
|
||||
"density": "0.75"
|
||||
},
|
||||
{
|
||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.5.3\/docs\/assets\/favicons\/android-chrome-48x48.png",
|
||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.6.4\/docs\/assets\/favicons\/android-chrome-48x48.png",
|
||||
"sizes": "48x48",
|
||||
"type": "image\/png",
|
||||
"density": "1.0"
|
||||
},
|
||||
{
|
||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.5.3\/docs\/assets\/favicons\/android-chrome-72x72.png",
|
||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.6.4\/docs\/assets\/favicons\/android-chrome-72x72.png",
|
||||
"sizes": "72x72",
|
||||
"type": "image\/png",
|
||||
"density": "1.5"
|
||||
},
|
||||
{
|
||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.5.3\/docs\/assets\/favicons\/android-chrome-96x96.png",
|
||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.6.4\/docs\/assets\/favicons\/android-chrome-96x96.png",
|
||||
"sizes": "96x96",
|
||||
"type": "image\/png",
|
||||
"density": "2.0"
|
||||
},
|
||||
{
|
||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.5.3\/docs\/assets\/favicons\/android-chrome-144x144.png",
|
||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.6.4\/docs\/assets\/favicons\/android-chrome-144x144.png",
|
||||
"sizes": "144x144",
|
||||
"type": "image\/png",
|
||||
"density": "3.0"
|
||||
},
|
||||
{
|
||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.5.3\/docs\/assets\/favicons\/android-chrome-192x192.png",
|
||||
"src": "https:\/\/cdn.rawgit.com\/progrium\/dokku\/v0.6.4\/docs\/assets\/favicons\/android-chrome-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image\/png",
|
||||
"density": "4.0"
|
||||
|
||||
BIN
docs/assets/slack-logo.png
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
@@ -36,13 +36,13 @@ h1 {
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.header .navbar-brand a {
|
||||
background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/dokku.png);
|
||||
background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/dokku.png);
|
||||
text-indent: 40px;
|
||||
}
|
||||
.blurb {
|
||||
color: #424242;
|
||||
background-color: #ededed;
|
||||
background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/gplaypattern.png);
|
||||
background-image: url(https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/gplaypattern.png);
|
||||
padding: 45px 0;
|
||||
text-align: center;
|
||||
}
|
||||
@@ -163,6 +163,9 @@ h1 {
|
||||
.featurette-heading .text-muted {
|
||||
font-weight: 300;
|
||||
}
|
||||
.featurette img {
|
||||
width: 400px;
|
||||
}
|
||||
.slack-channel {
|
||||
background-color: #EEF1F7;
|
||||
font-size: 16px;
|
||||
@@ -175,6 +178,37 @@ h1 {
|
||||
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-weight: normal;
|
||||
@@ -196,6 +230,15 @@ a.list-group-item {
|
||||
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;
|
||||
}
|
||||
@@ -486,7 +529,15 @@ ul.fas li .fa-large:before, ul.fas li .fa-large:before {
|
||||
}
|
||||
}
|
||||
@media (min-width: 992px) {
|
||||
.featurette img {
|
||||
width: 300px;
|
||||
}
|
||||
.featurette-heading {
|
||||
margin-top: 120px;
|
||||
margin-top: 30px;
|
||||
}
|
||||
}
|
||||
@media (max-width: 992px) {
|
||||
.featurette img {
|
||||
width: 200px;
|
||||
}
|
||||
}
|
||||
|
||||
BIN
docs/assets/team/flink-hidden.jpg
Normal file
|
After Width: | Height: | Size: 57 KiB |
BIN
docs/assets/team/flink.jpg
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
docs/assets/team/josegonzalez-hidden.jpg
Normal file
|
After Width: | Height: | Size: 56 KiB |
BIN
docs/assets/team/josegonzalez.jpg
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
docs/assets/team/michaelshobbs-hidden.jpg
Normal file
|
After Width: | Height: | Size: 54 KiB |
BIN
docs/assets/team/michaelshobbs.jpg
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
docs/assets/team/morrisjobke-hidden.jpg
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
docs/assets/team/morrisjobke.jpg
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
docs/assets/team/progrium-hidden.jpg
Normal file
|
After Width: | Height: | Size: 54 KiB |
BIN
docs/assets/team/progrium.jpg
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
docs/assets/team/u2mejc-hidden.jpg
Normal file
|
After Width: | Height: | Size: 61 KiB |
BIN
docs/assets/team/u2mejc.jpg
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
@@ -2,6 +2,7 @@
|
||||
"max-versions": [
|
||||
"0.3.26",
|
||||
"0.4.14",
|
||||
"0.5.3"
|
||||
"0.5.8",
|
||||
"0.6.4"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -3,9 +3,10 @@
|
||||
> New as of 0.5.0
|
||||
|
||||
```
|
||||
checks <app> Show zero-downtime status
|
||||
checks:disable <app> Disable zero-downtime checks
|
||||
checks:enable <app> Enable zero-downtime checks
|
||||
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:
|
||||
@@ -15,10 +16,32 @@ dokku config:set --global DOKKU_DEFAULT_CHECKS_WAIT=30
|
||||
dokku config:set <app> DOKKU_DEFAULT_CHECKS_WAIT=30
|
||||
```
|
||||
|
||||
You can also choose to skip checks completely on a per-application basis:
|
||||
You can also choose to skip checks or disable zero-downtime completely on a per-application/per-process basis:
|
||||
|
||||
```shell
|
||||
dokku checks:disable <app>
|
||||
dokku checks:skip <app> worker,web
|
||||
```
|
||||
|
||||
```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:
|
||||
@@ -34,6 +57,8 @@ dokku config:set <app> DOKKU_WAIT_TO_RETIRE=120
|
||||
|
||||
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
|
||||
@@ -272,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
|
||||
```
|
||||
|
||||
@@ -13,6 +13,8 @@ config:unset (<app>|--global) KEY1 [KEY2 ...] Unset one or more conf
|
||||
|
||||
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).
|
||||
|
||||
For buildpack deploys, Dokku will create a `/app/.env` file that can be used for legacy buildpacks. Note that this is *not* updated when `config:set` or `config:unset` is called, and is only written during a `deploy` or `ps:rebuild`. Developers are encouraged to instead read from the application environment directly, as the proper values will be available then.
|
||||
|
||||
> 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.
|
||||
|
||||
You can set multiple environment variables at once:
|
||||
|
||||
@@ -4,6 +4,7 @@ Dokku normally defaults to using [heroku buildpacks](https://devcenter.heroku.co
|
||||
|
||||
- Use `dokku config:set` to set the `BUILDPACK_URL` environment variable.
|
||||
- Add `BUILDPACK_URL` to a committed `.env` file in the root of your repository.
|
||||
- See the [environment variable documentation](/dokku/configuration-management/) for more details.
|
||||
- Create a `.buildpacks` file in the root of your repository.
|
||||
|
||||
## Specifying a custom buildpack
|
||||
@@ -56,6 +57,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:
|
||||
@@ -65,7 +91,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.
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ Simply place an `app.json` file in the root of your repository or for dockerfile
|
||||
"scripts": {
|
||||
"dokku": {
|
||||
"predeploy": "touch /app/predeploy.test",
|
||||
"postdeploy": "curl https://some.external.api.service.com/deployment?state=succuss"
|
||||
"postdeploy": "curl https://some.external.api.service.com/deployment?state=success"
|
||||
}
|
||||
},
|
||||
"env": {
|
||||
|
||||
@@ -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.
|
||||
@@ -13,12 +15,14 @@ To use a dockerfiles for deployment, commit a valid `Dockerfile` to the root of
|
||||
|
||||
> Changed as of 0.5.0
|
||||
|
||||
Dokku will extract all tcp ports exposed using the `EXPOSE` directive 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 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.
|
||||
|
||||
> 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 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
|
||||
|
||||
By default no arguments are passed to `docker run` when deploying the container and the `CMD` or `ENTRYPOINT` defined in the `Dockerfile` are executed. You can take advantage of docker ability of overriding the `CMD` or passing parameters to your `ENTRYPOINT` setting `$DOKKU_DOCKERFILE_START_CMD`. Let's say for example you are deploying a base nodejs image, with the following `ENTRYPOINT`:
|
||||
|
||||
98
docs/deployment/domain-configuration.md
Normal 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.
|
||||
@@ -14,21 +14,21 @@ tags:destroy <app> <tag> Remove app image tag
|
||||
Example:
|
||||
|
||||
```
|
||||
root@dokku:~# dokku tags node-js-app
|
||||
$ dokku tags node-js-app
|
||||
=====> Image tags for dokku/node-js-app
|
||||
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
|
||||
dokku/node-js-app latest 936a42f25901 About a minute ago 1.025 GB
|
||||
|
||||
root@dokku:~# dokku tags:create node-js-app v0.9.0
|
||||
$ dokku tags:create node-js-app v0.9.0
|
||||
=====> Added v0.9.0 tag to dokku/node-js-app
|
||||
|
||||
root@dokku:~# dokku tags node-js-app
|
||||
$ dokku tags node-js-app
|
||||
=====> Image tags for dokku/node-js-app
|
||||
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
|
||||
dokku/node-js-app latest 936a42f25901 About a minute ago 1.025 GB
|
||||
dokku/node-js-app v0.9.0 936a42f25901 About a minute ago 1.025 GB
|
||||
|
||||
root@dokku:~# dokku tags:deploy node-js-app v0.9.0
|
||||
$ dokku tags:deploy node-js-app v0.9.0
|
||||
-----> Releasing node-js-app (dokku/node-js-app:v0.9.0)...
|
||||
-----> Deploying node-js-app (dokku/node-js-app:v0.9.0)...
|
||||
-----> Running pre-flight checks
|
||||
@@ -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"
|
||||
```
|
||||
|
||||
@@ -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`:
|
||||
|
||||
@@ -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.
|
||||
@@ -48,7 +54,7 @@ If you decide to obtain a CA signed certficate, you can import that certificate
|
||||
The `certs:info` command will simply inspect the install SSL cert and print out details. NOTE: The server-wide certificate will be inspect if installed and no app-specific certificate exists.
|
||||
|
||||
```
|
||||
root@dokku:~/dokku# dokku certs:info node-js-app
|
||||
$ dokku certs:info node-js-app
|
||||
-----> Fetching SSL Endpoint info for node-js-app...
|
||||
-----> Certificate details:
|
||||
=====> Common Name(s):
|
||||
@@ -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
|
||||
|
||||
@@ -106,12 +84,6 @@ Your application has access to the HTTP headers `X-Forwarded-Proto`, `X-Forwarde
|
||||
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
|
||||
upstream {{ .APP }} {
|
||||
{{ range .DOKKU_APP_LISTENERS | split " " }}
|
||||
server {{ . }};
|
||||
{{ end }}
|
||||
}
|
||||
|
||||
server {
|
||||
listen [::]:{{ .NGINX_PORT }};
|
||||
listen {{ .NGINX_PORT }};
|
||||
@@ -135,6 +107,12 @@ server {
|
||||
}
|
||||
include {{ .DOKKU_ROOT }}/{{ .APP }}/nginx.conf.d/*.conf;
|
||||
}
|
||||
|
||||
upstream {{ .APP }} {
|
||||
{{ range .DOKKU_APP_LISTENERS | split " " }}
|
||||
server {{ . }};
|
||||
{{ end }}
|
||||
}
|
||||
```
|
||||
|
||||
Only use this option if:
|
||||
|
||||
@@ -155,3 +155,4 @@ A few notes:
|
||||
- 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](/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
|
||||
|
||||
@@ -29,69 +29,64 @@ The following plugin triggers describe those available to a dokku installation.
|
||||
|
||||
> The example plugin trigger code is not guaranteed to be implemented as in within dokkku, and are merely simplified examples. Please look at the dokku source for larger, more in-depth examples.
|
||||
|
||||
### `install`
|
||||
### `post-config-update`
|
||||
|
||||
- Description: Used to setup any files/configuration for a plugin.
|
||||
- Invoked by: `dokku plugin:install`.
|
||||
- Arguments: None
|
||||
- Description: Allows you to get notified when one or more configs is added or removed. Action can be *set* or *unset*
|
||||
- Invoked by: `dokku config:set`, `dokku config:unset`
|
||||
- Arguments: `$APP` `set|unset` `key1=VALUE1 key2=VALUE2`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Sets the hostname of the dokku server
|
||||
# based on the output of `hostname -f`
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
if [[ ! -f "$DOKKU_ROOT/HOSTNAME" ]]; then
|
||||
hostname -f > $DOKKU_ROOT/HOSTNAME
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `bind-external-ip`
|
||||
|
||||
- Description: Allows you to disable binding to the external box ip
|
||||
- Invoked by: `dokku deploy`
|
||||
- Arguments: `$APP`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Force always binding to the docker ip, no matter
|
||||
# what the settings are for a given app.
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
echo false
|
||||
```
|
||||
|
||||
### `check-deploy`
|
||||
|
||||
- Description: Allows you to run checks on a deploy before dokku allows the container to handle requests.
|
||||
- Invoked by: `dokku deploy`
|
||||
- Arguments: `$CONTAINER_ID $APP $INTERNAL_PORT $INTERNAL_IP_ADDRESS`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Disables deploys of containers based on whether the
|
||||
# `DOKKU_DISABLE_DEPLOY` env var is set to `true` for an app
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||
|
||||
CONTAINERID="$1"; APP="$2"; PORT="$3" ; HOSTNAME="${4:-localhost}"
|
||||
|
||||
eval "$(config_export app $APP)"
|
||||
DOKKU_DISABLE_DEPLOY="${DOKKU_DISABLE_DEPLOY:-false}"
|
||||
|
||||
if [[ "$DOKKU_DISABLE_DEPLOY" = "true" ]]; then
|
||||
echo -e "\033[31m\033[1mDeploys disabled, sorry.\033[0m"
|
||||
exit 1
|
||||
fi
|
||||
```
|
||||
|
||||
### `dependencies`
|
||||
|
||||
- Description: Used to install system-level dependencies. Invoked by `plugin:install-dependencies`.
|
||||
- Invoked by: `dokku plugin:install-dependencies`
|
||||
- Arguments: None
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Installs nginx for the current plugin
|
||||
# Supports both opensuse and ubuntu
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
case "$DOKKU_DISTRO" in
|
||||
debian|ubuntu)
|
||||
apt-get install --force-yes -qq -y nginx
|
||||
;;
|
||||
|
||||
opensuse)
|
||||
zypper -q in -y nginx
|
||||
;;
|
||||
esac
|
||||
```
|
||||
|
||||
### `update`
|
||||
|
||||
- Description: Can be used to run plugin updates on a regular interval. You can schedule the invoker in a cron-task to ensure your system gets regular updates.
|
||||
- Invoked by: `dokku plugin:update`.
|
||||
- Arguments: None
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Update the herokuish image from git source
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
cd /root/dokku
|
||||
sudo BUILD_STACK=true make install
|
||||
```
|
||||
|
||||
### `comands help` and `commands <PLUGIN_NAME>:help`
|
||||
|
||||
- Description: Your plugin should implement a `help` command in your `commands` file to take advantage of this plugin trigger. `commands help` is used by `dokku help` to aggregate all plugins abbreviated `help` output. Implementing `<PLUGIN_NAME>:help` in your `commands` file gives users looking for help, a more detailed output. 'commands help' must be implemented inside the `commands` plugin file. It's recommended that `PLUGIN_NAME:help` be added to the commands file to ensure consistency among community plugins and give you a new avenue to share rich help content with your user.
|
||||
@@ -139,10 +134,37 @@ help_content
|
||||
esac
|
||||
```
|
||||
|
||||
### `pre-build-buildpack`
|
||||
### `dependencies`
|
||||
|
||||
- Description: Allows you to run commands before the build image is created for a given app. For instance, this can be useful to add env vars to your container. Only applies to applications using buildpacks.
|
||||
- Invoked by: `dokku build`
|
||||
- Description: Used to install system-level dependencies. Invoked by `plugin:install-dependencies`.
|
||||
- Invoked by: `dokku plugin:install-dependencies`
|
||||
- Arguments: None
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Installs nginx for the current plugin
|
||||
# Supports both opensuse and ubuntu
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
case "$DOKKU_DISTRO" in
|
||||
debian|ubuntu)
|
||||
apt-get install --force-yes -qq -y nginx
|
||||
;;
|
||||
|
||||
opensuse)
|
||||
zypper -q in -y nginx
|
||||
;;
|
||||
esac
|
||||
```
|
||||
|
||||
### `deployed-app-image-tag`
|
||||
|
||||
- Description: Used to manage the tag of the image being deployed. Useful for deploying a specific version of an image, or when deploying from an external registry
|
||||
- Invoked by: `internal function dokku_deploy_cmd() (deploy phase)`
|
||||
- Arguments: `$APP`
|
||||
- Example:
|
||||
|
||||
@@ -151,13 +173,14 @@ esac
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
# TODO
|
||||
# customize the tag version
|
||||
echo 'not-latest'
|
||||
```
|
||||
|
||||
### `post-build-buildpack`
|
||||
### `deployed-app-repository`
|
||||
|
||||
- Description: Allows you to run commands after the build image is create for a given app. Only applies to applications using buildpacks.
|
||||
- Invoked by: `dokku build`
|
||||
- Description: Used to manage the remote repository of the image being deployed.
|
||||
- Invoked by: `internal function dokku_deploy_cmd() (deploy phase)`
|
||||
- Arguments: `$APP`
|
||||
- Example:
|
||||
|
||||
@@ -166,278 +189,13 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `pre-build-dockerfile`
|
||||
|
||||
- Description: Allows you to run commands before the build image is created for a given app. For instance, this can be useful to add env vars to your container. Only applies to applications using a dockerfile.
|
||||
- Invoked by: `dokku build`
|
||||
- Arguments: `$APP`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `post-build-dockerfile`
|
||||
|
||||
- Description: Allows you to run commands after the build image is create for a given app. Only applies to applications using a dockerfile.
|
||||
- Invoked by: `dokku build`
|
||||
- Arguments: `$APP`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `pre-release-buildpack`
|
||||
|
||||
- Description: Allows you to run commands before environment variables are set for the release step of the deploy. Only applies to applications using buildpacks.
|
||||
- Invoked by: `dokku release`
|
||||
- Arguments: `$APP $IMAGE_TAG`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Installs the graphicsmagick package into the container
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
|
||||
verify_app_name "$APP"
|
||||
|
||||
dokku_log_info1" Installing GraphicsMagick..."
|
||||
|
||||
CMD="cat > gm && \
|
||||
dpkg -s graphicsmagick > /dev/null 2>&1 || \
|
||||
(apt-get update && apt-get install -y graphicsmagick && apt-get clean)"
|
||||
|
||||
ID=$(docker run $DOKKU_GLOBAL_RUN_ARGS -i -a stdin $IMAGE /bin/bash -c "$CMD")
|
||||
test $(docker wait $ID) -eq 0
|
||||
docker commit $ID $IMAGE > /dev/null
|
||||
```
|
||||
|
||||
### `post-release-buildpack`
|
||||
|
||||
- Description: Allows you to run commands after environment variables are set for the release step of the deploy. Only applies to applications using buildpacks.
|
||||
- Invoked by: `dokku release`
|
||||
- Arguments: `$APP $IMAGE_TAG`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Installs a package specified by the `CONTAINER_PACKAGE` env var
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
|
||||
verify_app_name "$APP"
|
||||
|
||||
dokku_log_info1" Installing $CONTAINER_PACKAGE..."
|
||||
|
||||
CMD="cat > gm && \
|
||||
dpkg -s CONTAINER_PACKAGE > /dev/null 2>&1 || \
|
||||
(apt-get update && apt-get install -y CONTAINER_PACKAGE && apt-get clean)"
|
||||
|
||||
ID=$(docker run $DOKKU_GLOBAL_RUN_ARGS -i -a stdin $IMAGE /bin/bash -c "$CMD")
|
||||
test $(docker wait $ID) -eq 0
|
||||
docker commit $ID $IMAGE > /dev/null
|
||||
```
|
||||
|
||||
### `pre-release-dockerfile`
|
||||
|
||||
- Description: Allows you to run commands before environment variables are set for the release step of the deploy. Only applies to applications using a dockerfile.
|
||||
- Invoked by: `dokku release`
|
||||
- Arguments: `$APP $IMAGE_TAG`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
|
||||
verify_app_name "$APP"
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `post-release-dockerfile`
|
||||
|
||||
- Description: Allows you to run commands after environment variables are set for the release step of the deploy. Only applies to applications using a dockerfile.
|
||||
- Invoked by: `dokku release`
|
||||
- Arguments: `$APP $IMAGE_TAG`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
|
||||
verify_app_name "$APP"
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `check-deploy`
|
||||
|
||||
- Description: Allows you to run checks on a deploy before dokku allows the container to handle requests.
|
||||
- Invoked by: `dokku deploy`
|
||||
- Arguments: `$CONTAINER_ID $APP $INTERNAL_PORT $INTERNAL_IP_ADDRESS`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Disables deploys of containers based on whether the
|
||||
# `DOKKU_DISABLE_DEPLOY` env var is set to `true` for an app
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||
|
||||
CONTAINERID="$1"; APP="$2"; PORT="$3" ; HOSTNAME="${4:-localhost}"
|
||||
|
||||
eval "$(config_export app $APP)"
|
||||
DOKKU_DISABLE_DEPLOY="${DOKKU_DISABLE_DEPLOY:-false}"
|
||||
|
||||
if [[ "$DOKKU_DISABLE_DEPLOY" = "true" ]]; then
|
||||
echo -e "\033[31m\033[1mDeploys disabled, sorry.\033[0m"
|
||||
exit 1
|
||||
fi
|
||||
```
|
||||
|
||||
### `pre-deploy`
|
||||
|
||||
- Description: Allows the running of code before the container's process is started.
|
||||
- Invoked by: `dokku deploy`
|
||||
- Arguments: `$APP $IMAGE_TAG`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Runs gulp in our container
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
|
||||
verify_app_name "$APP"
|
||||
|
||||
dokku_log_info1 "Running gulp"
|
||||
id=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d $IMAGE /bin/bash -c "cd /app && gulp default")
|
||||
test $(docker wait $id) -eq 0
|
||||
docker commit $id $IMAGE > /dev/null
|
||||
dokku_log_info1 "Building UI Complete"
|
||||
```
|
||||
|
||||
### `post-create`
|
||||
|
||||
- Description: Can be used to run commands after an application is created.
|
||||
- Invoked by: `dokku apps:create`
|
||||
- Arguments: `$APP`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Runs a command to ensure that an app
|
||||
# has a postgres database when it is starting
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
APP="$1";
|
||||
POSTGRES="$1"
|
||||
|
||||
dokku postgres:create $POSTGRES
|
||||
dokku postgres:link $POSTGRES $APP
|
||||
```
|
||||
|
||||
### `post-deploy`
|
||||
|
||||
- Description: Allows running of commands after a deploy has completed. Dokku core currently uses this to switch traffic on nginx.
|
||||
- Invoked by: `dokku deploy`
|
||||
- Arguments: `$APP $INTERNAL_PORT $INTERNAL_IP_ADDRESS $IMAGE_TAG`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Notify an external service that a successful deploy has occurred.
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
curl "http://httpstat.us/200"
|
||||
```
|
||||
|
||||
### `pre-delete`
|
||||
|
||||
- Description: Can be used to run commands before an app is deleted.
|
||||
- Invoked by: `dokku apps:destroy`
|
||||
- Arguments: `$APP $IMAGE_TAG`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Clears out the gulp asset build cache for applications
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
|
||||
APP="$1"; GULP_CACHE_DIR="$DOKKU_ROOT/$APP/gulp"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
|
||||
verify_app_name "$APP"
|
||||
|
||||
if [[ -d $GULP_CACHE_DIR ]]; then
|
||||
docker run $DOKKU_GLOBAL_RUN_ARGS --rm -v "$GULP_CACHE_DIR:/gulp" "$IMAGE" find /gulp -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} \; || true
|
||||
fi
|
||||
```
|
||||
|
||||
### `post-delete`
|
||||
|
||||
- Description: Can be used to run commands after an application is deleted.
|
||||
- Invoked by: `dokku apps:destroy`
|
||||
- Arguments: `$APP $IMAGE_TAG`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Runs a command to ensure that an app's
|
||||
# postgres installation is removed
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
APP="$1";
|
||||
|
||||
dokku postgres:destroy $APP
|
||||
```
|
||||
|
||||
### `post-stop`
|
||||
|
||||
- Description: Can be used to run commands after an application is manually stopped
|
||||
- Invoked by: `dokku ps:stop`
|
||||
- Arguments: `$APP`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Marks an application as manually stopped
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
APP="$1";
|
||||
|
||||
dokku config:set --no-restart $APP MANUALLY_STOPPED=1
|
||||
echo 'derp.dkr.ecr.us-east-1.amazonaws.com'
|
||||
```
|
||||
|
||||
### `docker-args-build`
|
||||
|
||||
- Description:
|
||||
- Invoked by: `dokku build`
|
||||
- Invoked by: `internal function dokku_build() (build phase)`
|
||||
- Arguments: `$APP $IMAGE_SOURCE_TYPE`
|
||||
- Example:
|
||||
|
||||
@@ -485,38 +243,19 @@ verify_app_name "$APP"
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `bind-external-ip`
|
||||
### `git-post-pull`
|
||||
|
||||
- Description: Allows you to disable binding to the external box ip
|
||||
- Invoked by: `dokku deploy`
|
||||
- Description:
|
||||
- Invoked by: `dokku git-upload-pack`
|
||||
- Arguments: `$APP`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Force always binding to the docker ip, no matter
|
||||
# what the settings are for a given app.
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
echo false
|
||||
```
|
||||
|
||||
### `post-domains-update`
|
||||
|
||||
- Description: Allows you to run commands once the domain for an application has been updated. It also sends in the command that has been used. This can be "add", "clear" or "remove". The third argument will be the optional list of domains
|
||||
- Invoked by: `dokku domains:add`, `dokku domains:clear`, `dokku domains:remove`
|
||||
- Arguments: `$APP` `action name` `domains`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Reloads haproxy for our imaginary haproxy plugin
|
||||
# that replaces the nginx-vhosts plugin
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
sudo service haproxy reload
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `git-pre-pull`
|
||||
@@ -534,19 +273,23 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `git-post-pull`
|
||||
### `install`
|
||||
|
||||
- Description:
|
||||
- Invoked by: `dokku git-upload-pack`
|
||||
- Arguments: `$APP`
|
||||
- Description: Used to setup any files/configuration for a plugin.
|
||||
- Invoked by: `dokku plugin:install`.
|
||||
- Arguments: None
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Sets the hostname of the dokku server
|
||||
# based on the output of `hostname -f`
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
# TODO
|
||||
if [[ ! -f "$DOKKU_ROOT/HOSTNAME" ]]; then
|
||||
hostname -f > $DOKKU_ROOT/HOSTNAME
|
||||
fi
|
||||
```
|
||||
|
||||
### `nginx-hostname`
|
||||
@@ -585,6 +328,267 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
nginx -t
|
||||
```
|
||||
|
||||
### `post-build-buildpack`
|
||||
|
||||
- Description: Allows you to run commands after the build image is create for a given app. Only applies to applications using buildpacks.
|
||||
- Invoked by: `internal function dokku_build() (build phase)`
|
||||
- Arguments: `$APP`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `post-build-dockerfile`
|
||||
|
||||
- Description: Allows you to run commands after the build image is create for a given app. Only applies to applications using a dockerfile.
|
||||
- Invoked by: `internal function dokku_build() (build phase)`
|
||||
- Arguments: `$APP`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `post-create`
|
||||
|
||||
- Description: Can be used to run commands after an application is created.
|
||||
- Invoked by: `dokku apps:create`
|
||||
- Arguments: `$APP`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Runs a command to ensure that an app
|
||||
# has a postgres database when it is starting
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
APP="$1";
|
||||
POSTGRES="$1"
|
||||
|
||||
dokku postgres:create $POSTGRES
|
||||
dokku postgres:link $POSTGRES $APP
|
||||
```
|
||||
|
||||
### `post-delete`
|
||||
|
||||
- Description: Can be used to run commands after an application is deleted.
|
||||
- Invoked by: `dokku apps:destroy`
|
||||
- Arguments: `$APP $IMAGE_TAG`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Runs a command to ensure that an app's
|
||||
# postgres installation is removed
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
APP="$1";
|
||||
|
||||
dokku postgres:destroy $APP
|
||||
```
|
||||
|
||||
### `post-deploy`
|
||||
|
||||
- Description: Allows running of commands after an application's processes have been scaled up, but before old containers are torn down. Dokku core currently uses this to switch traffic on nginx.
|
||||
- Invoked by: `dokku deploy`
|
||||
- Arguments: `$APP $INTERNAL_PORT $INTERNAL_IP_ADDRESS $IMAGE_TAG`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Notify an external service that a successful deploy has occurred.
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
curl "http://httpstat.us/200"
|
||||
```
|
||||
|
||||
### `post-domains-update`
|
||||
|
||||
- Description: Allows you to run commands once the domain for an application has been updated. It also sends in the command that has been used. This can be "add", "clear" or "remove". The third argument will be the optional list of domains
|
||||
- Invoked by: `dokku domains:add`, `dokku domains:clear`, `dokku domains:remove`
|
||||
- Arguments: `$APP` `action name` `domains`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Reloads haproxy for our imaginary haproxy plugin
|
||||
# that replaces the nginx-vhosts plugin
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
sudo service haproxy reload
|
||||
```
|
||||
|
||||
### `post-proxy-ports-update`
|
||||
|
||||
- Description: Allows you to run commands once the proxy port mappings for an application have been updated. It also sends the invoking command. This can be "add", "clear" or "remove".
|
||||
- Invoked by: `dokku proxy:ports-add`, `dokku proxy:ports-clear`, `dokku proxy:ports-remove`
|
||||
- Arguments: `$APP` `action name`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Rebuilds haproxy config for our imaginary haproxy plugin
|
||||
# that replaces the nginx-vhosts plugin
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/haproxy/functions"
|
||||
APP="$1"; verify_app_name "$APP"
|
||||
|
||||
haproxy-build-config "$APP"
|
||||
```
|
||||
|
||||
### `post-release-buildpack`
|
||||
|
||||
- Description: Allows you to run commands after environment variables are set for the release step of the deploy. Only applies to applications using buildpacks.
|
||||
- Invoked by: `internal function dokku_release() (release phase)`
|
||||
- Arguments: `$APP $IMAGE_TAG`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Installs a package specified by the `CONTAINER_PACKAGE` env var
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
|
||||
verify_app_name "$APP"
|
||||
|
||||
dokku_log_info1" Installing $CONTAINER_PACKAGE..."
|
||||
|
||||
CMD="cat > gm && \
|
||||
dpkg -s CONTAINER_PACKAGE > /dev/null 2>&1 || \
|
||||
(apt-get update && apt-get install -y CONTAINER_PACKAGE && apt-get clean)"
|
||||
|
||||
ID=$(docker run $DOKKU_GLOBAL_RUN_ARGS -i -a stdin $IMAGE /bin/bash -c "$CMD")
|
||||
test $(docker wait $ID) -eq 0
|
||||
docker commit $ID $IMAGE > /dev/null
|
||||
```
|
||||
|
||||
### `post-release-dockerfile`
|
||||
|
||||
- Description: Allows you to run commands after environment variables are set for the release step of the deploy. Only applies to applications using a dockerfile.
|
||||
- Invoked by: `internal function dokku_release() (release phase)`
|
||||
- Arguments: `$APP $IMAGE_TAG`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
|
||||
verify_app_name "$APP"
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `post-stop`
|
||||
|
||||
- Description: Can be used to run commands after an application is manually stopped
|
||||
- Invoked by: `dokku ps:stop`
|
||||
- Arguments: `$APP`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Marks an application as manually stopped
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
APP="$1";
|
||||
|
||||
dokku config:set --no-restart $APP MANUALLY_STOPPED=1
|
||||
```
|
||||
|
||||
### `pre-build-buildpack`
|
||||
|
||||
- Description: Allows you to run commands before the build image is created for a given app. For instance, this can be useful to add env vars to your container. Only applies to applications using buildpacks.
|
||||
- Invoked by: `internal function dokku_build() (build phase)`
|
||||
- Arguments: `$APP`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `pre-build-dockerfile`
|
||||
|
||||
- Description: Allows you to run commands before the build image is created for a given app. For instance, this can be useful to add env vars to your container. Only applies to applications using a dockerfile.
|
||||
- Invoked by: `internal function dokku_build() (build phase)`
|
||||
- Arguments: `$APP`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `pre-delete`
|
||||
|
||||
- Description: Can be used to run commands before an app is deleted.
|
||||
- Invoked by: `dokku apps:destroy`
|
||||
- Arguments: `$APP $IMAGE_TAG`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Clears out the gulp asset build cache for applications
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
|
||||
APP="$1"; GULP_CACHE_DIR="$DOKKU_ROOT/$APP/gulp"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
|
||||
verify_app_name "$APP"
|
||||
|
||||
if [[ -d $GULP_CACHE_DIR ]]; then
|
||||
docker run $DOKKU_GLOBAL_RUN_ARGS --rm -v "$GULP_CACHE_DIR:/gulp" "$IMAGE" find /gulp -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} \; || true
|
||||
fi
|
||||
```
|
||||
|
||||
### `pre-deploy`
|
||||
|
||||
- Description: Allows the running of code before the application's processes are scaled up and after the docker images are prepared.
|
||||
- Invoked by: `dokku deploy`
|
||||
- Arguments: `$APP $IMAGE_TAG`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Runs gulp in our container
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
|
||||
verify_app_name "$APP"
|
||||
|
||||
dokku_log_info1 "Running gulp"
|
||||
id=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d $IMAGE /bin/bash -c "cd /app && gulp default")
|
||||
test $(docker wait $id) -eq 0
|
||||
docker commit $id $IMAGE > /dev/null
|
||||
dokku_log_info1 "Building UI Complete"
|
||||
```
|
||||
|
||||
### `pre-receive-app`
|
||||
|
||||
- Description: Allows you to customize the contents of an application directory before they are processed for deployment. The `IMAGE_SOURCE_TYPE` can be any of `[herokuish, dockerfile]`
|
||||
@@ -604,11 +608,124 @@ APP="$1"; IMAGE_SOURCE_TYPE="$2"; TMP_WORK_DIR="$3"; REV="$4"
|
||||
echo "$APP" > "$TMP_WORK_DIR/dokku-is-awesome"
|
||||
```
|
||||
|
||||
### `pre-release-buildpack`
|
||||
|
||||
- Description: Allows you to run commands before environment variables are set for the release step of the deploy. Only applies to applications using buildpacks.
|
||||
- Invoked by: `internal function dokku_release() (release phase)`
|
||||
- Arguments: `$APP $IMAGE_TAG`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Installs the graphicsmagick package into the container
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
|
||||
verify_app_name "$APP"
|
||||
|
||||
dokku_log_info1" Installing GraphicsMagick..."
|
||||
|
||||
CMD="cat > gm && \
|
||||
dpkg -s graphicsmagick > /dev/null 2>&1 || \
|
||||
(apt-get update && apt-get install -y graphicsmagick && apt-get clean)"
|
||||
|
||||
ID=$(docker run $DOKKU_GLOBAL_RUN_ARGS -i -a stdin $IMAGE /bin/bash -c "$CMD")
|
||||
test $(docker wait $ID) -eq 0
|
||||
docker commit $ID $IMAGE > /dev/null
|
||||
```
|
||||
|
||||
### `pre-release-dockerfile`
|
||||
|
||||
- Description: Allows you to run commands before environment variables are set for the release step of the deploy. Only applies to applications using a dockerfile.
|
||||
- Invoked by: `internal function dokku_release() (release phase)`
|
||||
- Arguments: `$APP $IMAGE_TAG`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
|
||||
verify_app_name "$APP"
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `pre-disable-vhost`
|
||||
|
||||
- Description: Allows you to run commands before the VHOST feature is disabled
|
||||
- Invoked by: `dokku domains:disable`
|
||||
- Arguments: `$APP`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
APP="$1"; verify_app_name "$APP"
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `pre-enable-vhost`
|
||||
|
||||
- Description: Allows you to run commands before the VHOST feature is enabled
|
||||
- Invoked by: `dokku domains:enable`
|
||||
- Arguments: `$APP`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
APP="$1"; verify_app_name "$APP"
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `post-certs-update`
|
||||
|
||||
- Description: Allows you to run commands after a cert is added/updated
|
||||
- Invoked by: `dokku certs:add`, `dokku certs:update`
|
||||
- Arguments: `$APP`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
APP="$1"; verify_app_name "$APP"
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `post-certs-remove`
|
||||
|
||||
- Description: Allows you to run commands after a cert is removed
|
||||
- Invoked by: `dokku certs:remove`
|
||||
- Arguments: `$APP`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
APP="$1"; verify_app_name "$APP"
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `receive-app`
|
||||
|
||||
- Description: Allows you to customize what occurs when an app is received. Normally just triggers an application build.
|
||||
- Invoked by: `dokku git-hook`, `dokku ps:rebuild`
|
||||
- Arguments: `$APP $REV`
|
||||
- Arguments: `$APP $REV` (`$REV` may not be included in cases where a repository is not pushed)
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
@@ -646,6 +763,23 @@ fi
|
||||
plugn trigger receive-app $APP $newrev
|
||||
```
|
||||
|
||||
### `retire-container-failed`
|
||||
|
||||
- Description: Allows you to run commands if/when retiring old containers has failed
|
||||
- Invoked by: `dokku deploy`
|
||||
- Arguments: `$APP`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Send an email when a container failed to retire
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
APP="$1"; HOSTNAME=$(hostname -s)
|
||||
|
||||
mail -s "$APP containers on $HOSTNAME failed to retire" ops@example.com
|
||||
```
|
||||
|
||||
### `tags-create`
|
||||
|
||||
- Description: Allows you to run commands once a tag for an application image has been added
|
||||
@@ -682,21 +816,21 @@ APP="$1"; IMAGE_TAG="$2"
|
||||
some code to remove a docker hub tag because it's not implemented in the CLI....
|
||||
```
|
||||
|
||||
### `retire-container-failed`
|
||||
### `update`
|
||||
|
||||
- Description: Allows you to run commands if/when retiring old containers has failed
|
||||
- Invoked by: `dokku deploy`
|
||||
- Arguments: `$APP`
|
||||
- Description: Can be used to run plugin updates on a regular interval. You can schedule the invoker in a cron-task to ensure your system gets regular updates.
|
||||
- Invoked by: `dokku plugin:update`.
|
||||
- Arguments: None
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Send an email when a container failed to retire
|
||||
# Update the herokuish image from git source
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
APP="$1"; HOSTNAME=$(hostname -s)
|
||||
|
||||
mail -s "$APP containers on $HOSTNAME failed to retire" ops@example.com
|
||||
cd /root/dokku
|
||||
sudo BUILD_STACK=true make install
|
||||
```
|
||||
|
||||
### `user-auth`
|
||||
|
||||
@@ -8,7 +8,6 @@ To propose a release, the following tasks need to be performed:
|
||||
- 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.
|
||||
@@ -67,7 +66,7 @@ The workflow looks like this:
|
||||
```shell
|
||||
# having dokku-arch in ../dokku-arch
|
||||
vagrant up build-arch
|
||||
# wait for "==> build-arch: ==> Finished making: dokku 0.5.3-2 (Mon Feb 22 23:20:37 CET 2016)"
|
||||
# wait for "==> build-arch: ==> Finished making: dokku 0.6.4-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'
|
||||
|
||||
23
docs/dns.md
@@ -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.
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ This example demonstrates how to mount the recommended directory to `/storage` i
|
||||
```
|
||||
$ dokku storage:mount app-name /var/lib/dokku/data/storage:/storage
|
||||
```
|
||||
Dokku will then mount the shared contents of`/var/lib/dokku/storage` to `/storage` inside the container.
|
||||
Dokku will then mount the shared contents of`/var/lib/dokku/data/storage` to `/storage` inside the container.
|
||||
|
||||
## Use Cases
|
||||
|
||||
@@ -41,6 +41,15 @@ Your app may be used in a cluster that requires containers or resources not runn
|
||||
|
||||
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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
120
docs/home.html
@@ -10,30 +10,30 @@
|
||||
<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.5.3/docs/assets/favicons/apple-touch-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/apple-touch-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/apple-touch-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/apple-touch-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/apple-touch-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/apple-touch-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/apple-touch-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/apple-touch-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/manifest.json">
|
||||
<link rel="shortcut icon" href="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/favicon.ico">
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/apple-touch-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/apple-touch-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/apple-touch-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/apple-touch-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/apple-touch-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/apple-touch-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/apple-touch-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/apple-touch-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/manifest.json">
|
||||
<link rel="shortcut icon" href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/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.5.3/docs/assets/favicons/mstile-144x144.png">
|
||||
<meta name="msapplication-config" content="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/browserconfig.xml">
|
||||
<meta name="msapplication-TileImage" content="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/mstile-144x144.png">
|
||||
<meta name="msapplication-config" content="https://cdn.rawgit.com/dokku/dokku/v0.6.4/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.2/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/style.css" rel="stylesheet">
|
||||
<link href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/style.css" rel="stylesheet">
|
||||
<!-- <link href="/dokku/docs/assets/style.css" rel="stylesheet"> -->
|
||||
<style>
|
||||
</style>
|
||||
@@ -47,6 +47,9 @@
|
||||
<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>
|
||||
@@ -87,17 +90,17 @@
|
||||
</div>
|
||||
<div class="shell shell-curl shell-active">
|
||||
<p class="line">
|
||||
<span class="output"> # only works on debian systems!</span>
|
||||
<span class="output"> # for debian systems, installs dokku via apt-get</span>
|
||||
</p>
|
||||
<p class="line">
|
||||
<span class="path"></span>
|
||||
<span class="prompt">$</span>
|
||||
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.5.3/bootstrap.sh</span>
|
||||
<span class="command">wget https://raw.githubusercontent.com/dokku/dokku/v0.6.4/bootstrap.sh</span>
|
||||
</p>
|
||||
<p class="line">
|
||||
<span class="path"></span>
|
||||
<span class="prompt">$</span>
|
||||
<span class="command">sudo DOKKU_TAG=v0.5.3 bash bootstrap.sh</span>
|
||||
<span class="command">sudo DOKKU_TAG=v0.6.4 bash bootstrap.sh</span>
|
||||
</p>
|
||||
<p class="line">
|
||||
<span class="output"> # go to your server's IP and follow the web installer</span>
|
||||
@@ -170,11 +173,21 @@
|
||||
<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 -->
|
||||
|
||||
<hr class="featurette-divider">
|
||||
|
||||
<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>
|
||||
@@ -208,21 +221,62 @@
|
||||
<img class="featurette-image img-responsive center-block" alt="Extend Logo" src="./assets/extend.png">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="featurette-divider">
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<div class="container-fluid slack-channel">
|
||||
Have a question? Join us in our public slack channel!
|
||||
<div class="container-fluid slack-channel team-members">
|
||||
<h3>Meet the core team</h3>
|
||||
|
||||
<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 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>
|
||||
|
||||
@@ -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.5.3/bootstrap.sh</span>
|
||||
</p>
|
||||
<p class="line">
|
||||
<span class="path">~</span>
|
||||
<span class="prompt">$</span>
|
||||
<span class="command">sudo DOKKU_TAG=v0.5.3 bash bootstrap.sh</span>
|
||||
</p>
|
||||
<p class="line">
|
||||
<span class="output"># => 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>
|
||||
|
||||
@@ -15,18 +15,25 @@ 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.5.3/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.5.3 bash bootstrap.sh
|
||||
# for debian systems, installs dokku via apt-get
|
||||
wget https://raw.githubusercontent.com/dokku/dokku/v0.6.4/bootstrap.sh
|
||||
sudo DOKKU_TAG=v0.6.4 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
|
||||
|
||||
233
docs/nginx.md
@@ -17,14 +17,14 @@ Dokku uses a templating library by the name of [sigil](https://github.com/glider
|
||||
- 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
|
||||
|
||||
> 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`.
|
||||
|
||||
### Example Custom Template
|
||||
|
||||
Use case: add an `X-Served-By` header to requests
|
||||
```
|
||||
upstream {{ .APP }} {
|
||||
{{ range .DOKKU_APP_LISTENERS | split " " }}
|
||||
server {{ . }};
|
||||
{{ end }}
|
||||
}
|
||||
server {
|
||||
listen [::]:{{ .NGINX_PORT }};
|
||||
listen {{ .NGINX_PORT }};
|
||||
@@ -35,6 +35,13 @@ server {
|
||||
# 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_http_version 1.1;
|
||||
@@ -48,9 +55,13 @@ server {
|
||||
}
|
||||
include {{ .DOKKU_ROOT }}/{{ .APP }}/nginx.conf.d/*.conf;
|
||||
}
|
||||
```
|
||||
|
||||
The above is a sample http configuration that adds an `X-Served-By` header to requests.
|
||||
upstream {{ .APP }} {
|
||||
{{ range .DOKKU_APP_LISTENERS | split " " }}
|
||||
server {{ . }};
|
||||
{{ end }}
|
||||
}
|
||||
```
|
||||
|
||||
### Available template variables
|
||||
```
|
||||
@@ -61,11 +72,111 @@ The above is a sample http configuration that adds an `X-Served-By` header to re
|
||||
{{ .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
|
||||
```
|
||||
|
||||
> 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`.
|
||||
|
||||
|
||||
### 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 template will include everything from your apps `nginx.conf.d/` subdirectory in the main `server {}` block (see above):
|
||||
@@ -83,107 +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
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
You can also use the built-in `domains` plugin to handle:
|
||||
|
||||
### Domains plugin
|
||||
|
||||
> 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
|
||||
```
|
||||
|
||||
### 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
|
||||
```
|
||||
## Disabling VHOSTS
|
||||
|
||||
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
|
||||
|
||||
@@ -200,3 +227,7 @@ See the [ssl documentation](/dokku/deployment/ssl-configuration/).
|
||||
## Disabling Nginx
|
||||
|
||||
See the [proxy documentation](/dokku/proxy/).
|
||||
|
||||
## Managing Proxy Port mappings
|
||||
|
||||
See the [proxy documentation](/dokku/proxy/#proxy-port-mapping).
|
||||
|
||||
@@ -63,6 +63,7 @@ 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
|
||||
@@ -72,6 +73,7 @@ Note: The following plugins have been supplied by our community and may not have
|
||||
[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
|
||||
@@ -139,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|
|
||||
|
||||
@@ -149,13 +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 |
|
||||
| ------------------------------------------------------------------------------------------------- | --------------------- | --------------------- |
|
||||
| [etcd](https://github.com/basgys/dokku-etcd) | [basgys][] | 0.4.x |
|
||||
| [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
|
||||
|
||||
@@ -179,11 +185,14 @@ 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+ |
|
||||
@@ -193,17 +202,20 @@ Note: The following plugins have been supplied by our community and may not have
|
||||
| [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
|
||||
|
||||
@@ -222,15 +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+ |
|
||||
| [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.
|
||||
|
||||
|
||||
@@ -1,30 +1,80 @@
|
||||
# Proxy plugin
|
||||
|
||||
> New as of 0.5.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.
|
||||
> New as of 0.5.0, Enhanced in 0.6.0
|
||||
|
||||
```
|
||||
proxy:disable <app> Disable proxy for app
|
||||
proxy:enable <app> Enable proxy for app
|
||||
proxy:set <app> <proxy_type> NOT IMPLEMENTED YET!!
|
||||
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>|<scheme>:<host-port>:<container-port>...] Unset proxy port mappings for app
|
||||
proxy:set <app> <proxy-type> Set proxy type for app
|
||||
```
|
||||
|
||||
In Dokku 0.5.0, port proxying was decoupled from the `nginx-vhosts` plugin into the proxy plugin. Dokku 0.6.0 introduced the ability to map host ports to specific container ports. In the future this will allow other proxy software - such as HAProxy or Caddy - to be used in place of nginx.
|
||||
|
||||
## 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.
|
||||
> New as of 0.5.0
|
||||
|
||||
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 for every deploy, e.g. `0.0.0.0:32771->5000/tcp`.
|
||||
|
||||
```shell
|
||||
# container bound to docker interface
|
||||
root@dokku:~/dokku# docker ps
|
||||
$ 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
|
||||
# internal IP address for the container
|
||||
$ docker inspect --format '{{ .NetworkSettings.IPAddress }}' node-js-app.web.1
|
||||
172.17.0.6
|
||||
|
||||
# disable the proxy so it listens on a host ip address
|
||||
$ dokku proxy:disable node-js-app
|
||||
|
||||
# container bound to all interfaces
|
||||
root@dokku:/home/dokku# docker ps
|
||||
$ 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
|
||||
```
|
||||
|
||||
## Proxy port mapping
|
||||
|
||||
> New as of 0.6.0
|
||||
|
||||
You can now configure `host -> container` port mappings with the `proxy:ports-*` commands. This mapping is currently supported by the built-in nginx-vhosts plugin.
|
||||
|
||||
```shell
|
||||
$ dokku proxy:ports node-js-app
|
||||
-----> Port mappings for node-js-app
|
||||
-----> scheme host port container port
|
||||
http 80 5000
|
||||
|
||||
$ curl http://node-js-app.dokku.me
|
||||
Hello World!
|
||||
|
||||
$ curl http://node-js-app.dokku.me:8080
|
||||
curl: (7) Failed to connect to node-js-app.dokku.me port 8080: Connection refused
|
||||
|
||||
$ dokku proxy:ports-add node-js-app http:8080:5000
|
||||
-----> Setting config vars
|
||||
DOKKU_PROXY_PORT_MAP: http:80:5000 http:8080:5000
|
||||
-----> Configuring node-js-app.dokku.me...(using built-in template)
|
||||
-----> Creating http nginx.conf
|
||||
-----> Running nginx-pre-reload
|
||||
Reloading nginx
|
||||
|
||||
$ curl http://node-js-app.dokku.me
|
||||
Hello World!
|
||||
|
||||
$ curl http://node-js-app.dokku.me:8080
|
||||
Hello World!
|
||||
```
|
||||
|
||||
By default, buildpack apps and dockerfile apps **without** explicitly exposed ports (i.e. using the `EXPOSE` directive) will be configured with a listener on port `80` (and additionally a listener on 443 if ssl is enabled) that will proxy to the application container on port `5000`. Dockerfile apps **with** explicitly exposed ports will be configured with a listener on each exposed port and will proxy to that same port of the deployed application container.
|
||||
|
||||
> NOTE: This default behavior **will not** be automatically changed on subsequent pushes and must be manipulated with the `proxy:ports-*` syntax detailed above.
|
||||
|
||||
@@ -10,26 +10,26 @@
|
||||
<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.5.3/docs/assets/favicons/apple-touch-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/apple-touch-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/apple-touch-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/apple-touch-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/apple-touch-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/apple-touch-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/apple-touch-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/apple-touch-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/manifest.json">
|
||||
<link rel="shortcut icon" href="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/favicon.ico">
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/apple-touch-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/apple-touch-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/apple-touch-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/apple-touch-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/apple-touch-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/apple-touch-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/apple-touch-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/apple-touch-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/android-chrome-192x192.png" sizes="192x192">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/favicon-96x96.png" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/manifest.json">
|
||||
<link rel="shortcut icon" href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/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.5.3/docs/assets/favicons/mstile-144x144.png">
|
||||
<meta name="msapplication-config" content="https://cdn.rawgit.com/dokku/dokku/v0.5.3/docs/assets/favicons/browserconfig.xml">
|
||||
<meta name="msapplication-TileImage" content="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/mstile-144x144.png">
|
||||
<meta name="msapplication-config" content="https://cdn.rawgit.com/dokku/dokku/v0.6.4/docs/assets/favicons/browserconfig.xml">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
<script>
|
||||
@@ -43,7 +43,7 @@
|
||||
</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.5.3/docs/assets/style.css" rel="stylesheet">
|
||||
<link href="https://cdn.rawgit.com/dokku/dokku/v0.6.4/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>
|
||||
@@ -61,6 +61,9 @@
|
||||
<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>
|
||||
@@ -107,7 +110,8 @@
|
||||
<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/dokku-events-logs/" class="list-group-item">Dokku Event Logs</a>
|
||||
@@ -184,6 +188,8 @@
|
||||
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) {
|
||||
@@ -234,6 +240,46 @@
|
||||
}
|
||||
};
|
||||
|
||||
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.toLowerCase().indexOf('new as of') !== -1) {
|
||||
addClass(el, 'new-as-of');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Troubleshooting
|
||||
# Troubleshooting
|
||||
|
||||
__Symptom:__ I deployed my app but I am getting the default nginx page
|
||||
|
||||
@@ -7,7 +7,7 @@ __Solution:__
|
||||
Most of the time it's caused by some defaults newer versions of nginx set. To make sure that's the issue you're having run the following:
|
||||
|
||||
```
|
||||
root@dockerapps:/home/git# nginx
|
||||
$ nginx -t
|
||||
nginx: [emerg] could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32
|
||||
```
|
||||
|
||||
@@ -27,9 +27,9 @@ A value of 64 would allow domains with up to 64 characters. Set it to 128 if you
|
||||
Save the file and try stopping nginx and starting it again:
|
||||
|
||||
```
|
||||
root@dockerapps:~/dokku# /etc/init.d/nginx stop
|
||||
$ /etc/init.d/nginx stop
|
||||
* Stopping nginx nginx [ OK ]
|
||||
root@dockerapps:~/dokku# /etc/init.d/nginx start
|
||||
$ /etc/init.d/nginx start
|
||||
* Starting nginx nginx [ OK ]
|
||||
```
|
||||
|
||||
@@ -65,14 +65,14 @@ __Solution (Less solution, more helpful troubleshooting steps):__
|
||||
Find the failed phase's container image (*077581956a92* in this example)
|
||||
|
||||
```
|
||||
root@dokku:~# docker ps -a | grep build
|
||||
$ docker ps -a | grep build
|
||||
94d9515e6d93 077581956a92 "/build" 29 minutes ago Exited (0) 25 minutes ago cocky_bell
|
||||
```
|
||||
|
||||
Start a new container with the failed image and poke around (i.e. ensure you can access the internet from within the container or attempt the failed command, if known)
|
||||
|
||||
```
|
||||
root@dokku:~# docker run -ti 077581956a92 /bin/bash
|
||||
$ docker run -ti 077581956a92 /bin/bash
|
||||
root@9763ab86e1b4:/# curl -s -S icanhazip.com
|
||||
192.168.0.1
|
||||
curl http://s3pository.heroku.com/node/v0.10.30/node-v0.10.30-linux-x64.tar.gz -o node-v0.10.30-linux-x64.tar.gz
|
||||
@@ -84,7 +84,7 @@ __Solution (Less solution, more helpful troubleshooting steps):__
|
||||
Additionally we've seen issues if changing networks that have different DNS resolvers. In this case, you can run the following to update your resolv.conf
|
||||
|
||||
```
|
||||
root@dokku:~# resolvconf -u
|
||||
$ resolvconf -u
|
||||
```
|
||||
|
||||
Please see https://github.com/dokku/dokku/issues/841 and https://github.com/dokku/dokku/issues/649
|
||||
|
||||
@@ -1,36 +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](/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.
|
||||
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.
|
||||
|
||||
## Migration Guides
|
||||
|
||||
Migration guides contain information regarding the new features introduced in each version and the migration path between versions.
|
||||
Before upgrading, check the migration guides to get comfortable with new features and prepare your deployment to be upgraded.
|
||||
|
||||
- [0.5 Migration Guide](/dokku/appendices/0.5.0-migration-guide/)
|
||||
- [0.6 Migration Guide](/dokku/appendices/0.6.0-migration-guide/)
|
||||
|
||||
## General Information
|
||||
## Upgrade Instructions
|
||||
|
||||
Upgrading is not advised on running apps. Stop them before with `dokku ps:stop <app>`.
|
||||
|
||||
Before using `apt-get install`, run `apt-get update` to download the latest packages.
|
||||
|
||||
If dokku was installed via a debian package, you can upgrade dokku via the following command:
|
||||
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
|
||||
|
||||
@@ -39,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 and restart 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
|
||||
|
||||
7
dokku
@@ -100,13 +100,10 @@ execute_dokku_cmd() {
|
||||
nginx|nginx:*)
|
||||
local PLUGIN_NAME=${PLUGIN_NAME/nginx/nginx-vhosts}
|
||||
;;
|
||||
receive|deploy|build|release)
|
||||
deploy|delete|ls|run|cleanup)
|
||||
local PLUGIN_NAME="00_dokku-standard"
|
||||
;;
|
||||
trace|delete|ls|run|cleanup)
|
||||
local PLUGIN_NAME="00_dokku-standard"
|
||||
;;
|
||||
url|urls|report|version)
|
||||
trace|url|urls|report|version)
|
||||
local PLUGIN_NAME="00_dokku-standard"
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/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"
|
||||
@@ -22,52 +23,58 @@ get_phase_script() {
|
||||
|
||||
execute_script() {
|
||||
declare desc="executes appropriate phase script key from app.json"
|
||||
local APP="$1"; local IMAGE="$2"; local PHASE_SCRIPT_KEY="$3"
|
||||
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="export HOME=/app ; "
|
||||
local COMMAND+=" cd \$HOME ; "
|
||||
local COMMAND+=" for file in /app/.profile.d/*; do source \$file; done ; "
|
||||
local COMMAND+=" echo restoring installation cache... ; "
|
||||
local COMMAND+=" rm -rf /tmp/cache || true ; "
|
||||
local COMMAND+=" ln -sf /cache /tmp/cache || true ; "
|
||||
local COMMAND+=" $SCRIPT_CMD ; RC=\$? ;"
|
||||
local COMMAND+=" echo removing installation cache... ; "
|
||||
local COMMAND+=" rm -f /tmp/cache || true ; "
|
||||
local COMMAND+=" exit \$RC "
|
||||
local DOCKER_ARGS=$(: | plugn trigger docker-args-deploy "$APP")
|
||||
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" --label=dokku_phase_script="${PHASE_SCRIPT_KEY}" -d -v "$CACHE_DIR:/cache" $DOCKER_ARGS "$IMAGE" /bin/bash -c "$COMMAND")
|
||||
test "$(docker wait "$id")" -eq 0 || (dokku_container_log_verbose_quiet "$id"; exit 1)
|
||||
dokku_container_log_verbose_quiet "$id"
|
||||
if [[ "$PHASE_SCRIPT_KEY" != "postdeploy" ]];then
|
||||
docker commit "$id" "$IMAGE" > /dev/null
|
||||
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
|
||||
}
|
||||
|
||||
exec_app_json_scripts() {
|
||||
declare desc="core app.json scripts execution"
|
||||
local trigger="$0 app_json_scripts"
|
||||
local APP="$1"
|
||||
|
||||
case "$0" in
|
||||
*pre-deploy)
|
||||
local IMAGE_TAG="$2"
|
||||
local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG")
|
||||
local PHASE_SCRIPT_KEY="predeploy"
|
||||
;;
|
||||
*post-deploy)
|
||||
local IMAGE_TAG="$4"
|
||||
local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG")
|
||||
local PHASE_SCRIPT_KEY="postdeploy"
|
||||
;;
|
||||
esac
|
||||
|
||||
dokku_log_info1 "Attempting to run scripts.dokku.$PHASE_SCRIPT_KEY from app.json (if defined)"
|
||||
execute_script "$APP" "$IMAGE" "$PHASE_SCRIPT_KEY"
|
||||
}
|
||||
|
||||
exec_app_json_scripts "$@"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core standard plugin"
|
||||
version = "0.5.3"
|
||||
version = "0.6.4"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
exec-app-json-scripts
|
||||
34
plugins/00_dokku-standard/post-deploy
Executable 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 "$@"
|
||||
@@ -1 +0,0 @@
|
||||
exec-app-json-scripts
|
||||
15
plugins/00_dokku-standard/pre-deploy
Executable 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 "$@"
|
||||
@@ -1,56 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||
|
||||
dokku_build_cmd() {
|
||||
declare desc="build phase"
|
||||
local cmd="build"
|
||||
local APP="$2"; local IMAGE_SOURCE_TYPE="$3"; local TMP_WORK_DIR="$4"; local IMAGE=$(get_app_image_name "$APP")
|
||||
verify_app_name "$APP"
|
||||
|
||||
local CACHE_DIR="$DOKKU_ROOT/$APP/cache"
|
||||
|
||||
eval "$(config_export app "$APP")"
|
||||
pushd "$TMP_WORK_DIR" &> /dev/null
|
||||
|
||||
case "$IMAGE_SOURCE_TYPE" in
|
||||
herokuish)
|
||||
local 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"
|
||||
|
||||
local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$IMAGE_SOURCE_TYPE")
|
||||
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true "
|
||||
# shellcheck disable=SC2086
|
||||
local 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
|
||||
local DOCKERFILE_PORTS=$(get_dockerfile_exposed_ports Dockerfile)
|
||||
[[ -n "$DOCKERFILE_PORTS" ]] && config_set --no-restart "$APP" DOKKU_DOCKERFILE_PORTS="$DOCKERFILE_PORTS"
|
||||
plugn trigger pre-build-dockerfile "$APP"
|
||||
|
||||
[[ "$DOKKU_DOCKERFILE_CACHE_BUILD" == "false" ]] && DOKKU_DOCKER_BUILD_OPTS="$DOKKU_DOCKER_BUILD_OPTS --no-cache"
|
||||
local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$IMAGE_SOURCE_TYPE")
|
||||
# shellcheck disable=SC2086
|
||||
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
|
||||
}
|
||||
|
||||
dokku_build_cmd "$@"
|
||||
@@ -1,165 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/checks/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/proxy/functions"
|
||||
|
||||
dokku_deploy_cmd() {
|
||||
declare desc="deploy phase"
|
||||
local cmd="deploy"
|
||||
[[ -z $2 ]] && dokku_log_fail "Please specify an app to deploy"
|
||||
local APP="$2"; local IMAGE_TAG="$3"; local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG")
|
||||
verify_app_name "$APP"
|
||||
plugn trigger pre-deploy "$APP" "$IMAGE_TAG"
|
||||
|
||||
is_image_herokuish_based "$IMAGE" && local DOKKU_HEROKUISH=true
|
||||
local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE"
|
||||
local oldids=$(get_app_container_ids "$APP")
|
||||
|
||||
local DOKKU_DEFAULT_DOCKER_ARGS=$(: | plugn trigger docker-args-deploy "$APP" "$IMAGE_TAG")
|
||||
local DOKKU_IS_APP_PROXY_ENABLED="$(is_app_proxy_enabled "$APP")"
|
||||
|
||||
local line; local PROC_TYPE; local PROC_COUNT; local CONTAINER_INDEX
|
||||
while read -r line || [[ -n "$line" ]]; do
|
||||
[[ "$line" =~ ^#.* ]] && continue
|
||||
line="$(strip_inline_comments "$line")"
|
||||
PROC_TYPE=${line%%=*}
|
||||
PROC_COUNT=${line#*=}
|
||||
CONTAINER_INDEX=1
|
||||
|
||||
while [[ $CONTAINER_INDEX -le $PROC_COUNT ]]; do
|
||||
local id=""; local port=""; local ipaddr=""
|
||||
local DOKKU_CONTAINER_ID_FILE="$DOKKU_ROOT/$APP/CONTAINER.$PROC_TYPE.$CONTAINER_INDEX"
|
||||
local DOKKU_IP_FILE="$DOKKU_ROOT/$APP/IP.$PROC_TYPE.$CONTAINER_INDEX"
|
||||
local DOKKU_PORT_FILE="$DOKKU_ROOT/$APP/PORT.$PROC_TYPE.$CONTAINER_INDEX"
|
||||
|
||||
# start the app
|
||||
local DOCKER_ARGS="$DOKKU_DEFAULT_DOCKER_ARGS"
|
||||
local DOCKER_ARGS+=" -e DYNO='$PROC_TYPE.$CONTAINER_INDEX' "
|
||||
[[ "$DOKKU_TRACE" ]] && local DOCKER_ARGS+=" -e TRACE=true "
|
||||
|
||||
[[ -n "$DOKKU_HEROKUISH" ]] && local START_CMD="/start $PROC_TYPE"
|
||||
|
||||
if [[ -z "$DOKKU_HEROKUISH" ]]; then
|
||||
local DOKKU_DOCKERFILE_PORTS=($(config_get "$APP" DOKKU_DOCKERFILE_PORTS || true))
|
||||
local DOKKU_DOCKERFILE_START_CMD=$(config_get "$APP" DOKKU_DOCKERFILE_START_CMD || true)
|
||||
local DOKKU_PROCFILE_START_CMD=$(get_cmd_from_procfile "$APP" "$PROC_TYPE")
|
||||
local START_CMD=${DOKKU_DOCKERFILE_START_CMD:-$DOKKU_PROCFILE_START_CMD}
|
||||
fi
|
||||
|
||||
if [[ "$PROC_TYPE" == "web" ]]; then
|
||||
if [[ -z "${DOKKU_DOCKERFILE_PORTS[*]}" ]]; then
|
||||
local port=5000
|
||||
local DOKKU_DOCKER_PORT_ARGS+="-p $port"
|
||||
else
|
||||
local p
|
||||
for p in ${DOKKU_DOCKERFILE_PORTS[*]};do
|
||||
if [[ ! "$p" =~ .*udp.* ]]; then
|
||||
# set port to first non-udp port
|
||||
local p=${p//\/tcp}
|
||||
local port=${port:="$p"}
|
||||
fi
|
||||
local DOKKU_DOCKER_PORT_ARGS+=" -p $p "
|
||||
done
|
||||
fi
|
||||
if [[ "$DOKKU_IS_APP_PROXY_ENABLED" == "true" ]]; then
|
||||
# shellcheck disable=SC2086
|
||||
local id=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d -e PORT=$port $DOCKER_ARGS $IMAGE $START_CMD)
|
||||
local ipaddr=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "$id")
|
||||
# Docker < 1.9 compatibility
|
||||
if [[ -z $ipaddr ]]; then
|
||||
local ipaddr=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' "$id")
|
||||
fi
|
||||
else
|
||||
# shellcheck disable=SC2086
|
||||
local id=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d $DOKKU_DOCKER_PORT_ARGS -e PORT=$port $DOCKER_ARGS $IMAGE $START_CMD)
|
||||
local port=$(docker port "$id" "$port" | sed 's/[0-9.]*://')
|
||||
local ipaddr=127.0.0.1
|
||||
fi
|
||||
else
|
||||
# shellcheck disable=SC2086
|
||||
local 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() {
|
||||
declare desc="wrapper function to kill newly started app container"
|
||||
local id="$1"
|
||||
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 [[ "$(is_app_checks_enabled "$APP")" == "false" ]]; then
|
||||
dokku_log_info1 "zero downtime is disabled for app ($APP). skipping pre-flight checks"
|
||||
else
|
||||
trap 'kill_new $id' 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"
|
||||
|
||||
# cleanup pre-migration files
|
||||
rm -f "$DOKKU_ROOT/$APP/CONTAINER" "$DOKKU_ROOT/$APP/IP" "$DOKKU_ROOT/$APP/PORT"
|
||||
|
||||
local CONTAINER_INDEX=$(( CONTAINER_INDEX + 1 ))
|
||||
done
|
||||
# cleanup when we scale down
|
||||
if [[ "$PROC_COUNT" == 0 ]]; then
|
||||
local CONTAINER_IDX_OFFSET=0
|
||||
else
|
||||
local CONTAINER_IDX_OFFSET=$((PROC_COUNT + 1))
|
||||
fi
|
||||
local container_state_filetype
|
||||
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" "$IMAGE_TAG"
|
||||
|
||||
# kill the old container
|
||||
if [[ -n "$oldids" ]]; then
|
||||
|
||||
if [[ -z "$DOKKU_WAIT_TO_RETIRE" ]]; then
|
||||
local DOKKU_APP_DOKKU_WAIT_TO_RETIRE=$(config_get "$APP" DOKKU_WAIT_TO_RETIRE || true)
|
||||
local DOKKU_GLOBAL_DOKKU_WAIT_TO_RETIRE=$(config_get --global DOKKU_WAIT_TO_RETIRE || true)
|
||||
local 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
|
||||
local WAIT="${DOKKU_WAIT_TO_RETIRE:-60}"
|
||||
dokku_log_info1 "Shutting down old containers in $WAIT seconds"
|
||||
local oldid
|
||||
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
|
||||
}
|
||||
|
||||
shift 1
|
||||
dokku_deploy_cmd "$@"
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||
|
||||
dokku_receive_cmd() {
|
||||
declare desc="receives an app kicks off deploy process"
|
||||
local cmd="receive"
|
||||
local APP="$2"; local IMAGE=$(get_app_image_name "$APP"); local IMAGE_SOURCE_TYPE="$3"; local TMP_WORK_DIR="$4"
|
||||
if [[ -z "$DOKKU_SKIP_CLEANUP" ]]; then
|
||||
dokku_log_info1 "Cleaning up..."
|
||||
docker_cleanup
|
||||
else
|
||||
dokku_log_info1 "DOKKU_SKIP_CLEANUP set. Skipping dokku cleanup"
|
||||
fi
|
||||
dokku_log_info1 "Building $APP from $IMAGE_SOURCE_TYPE..."
|
||||
config_set --no-restart "$APP" DOKKU_APP_TYPE="$IMAGE_SOURCE_TYPE" &> /dev/null
|
||||
dokku build "$APP" "$IMAGE_SOURCE_TYPE" "$TMP_WORK_DIR"
|
||||
release_and_deploy "$APP"
|
||||
}
|
||||
|
||||
dokku_receive_cmd "$@"
|
||||
@@ -1,40 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||
|
||||
dokku_release_cmd() {
|
||||
declare desc="release phase"
|
||||
local cmd="release"
|
||||
local APP="$2"; local IMAGE_SOURCE_TYPE="$3"; local IMAGE_TAG="$4"; local 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
|
||||
local 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
|
||||
local 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
|
||||
}
|
||||
|
||||
dokku_release_cmd "$@"
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/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() {
|
||||
@@ -20,9 +21,28 @@ dokku_run_cmd() {
|
||||
|
||||
local DOCKER_ARGS=$(: | plugn trigger docker-args-run "$APP" "$IMAGE_TAG")
|
||||
[[ "$DOKKU_TRACE" ]] && local DOCKER_ARGS+=" -e TRACE=true "
|
||||
[[ "$DOKKU_RM_CONTAINER" ]] && local DOKKU_RUN_OPTS="--rm"
|
||||
has_tty && local DOKKU_RUN_OPTS+=" -i -t"
|
||||
|
||||
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 "$@"
|
||||
}
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/checks/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions"
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/proxy/functions"
|
||||
|
||||
dokku_version_cmd() {
|
||||
declare desc="prints dokku version"
|
||||
|
||||
1
plugins/20_events/deployed-app-image-tag
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
1
plugins/20_events/deployed-app-repository
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core events logging plugin"
|
||||
version = "0.5.3"
|
||||
version = "0.6.4"
|
||||
[plugin.config]
|
||||
|
||||
1
plugins/20_events/post-certs-remove
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
1
plugins/20_events/post-certs-update
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
1
plugins/20_events/post-config-update
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
1
plugins/20_events/post-create
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
1
plugins/20_events/post-proxy-ports-update
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
1
plugins/20_events/post-stop
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
1
plugins/20_events/pre-disable-vhost
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
1
plugins/20_events/pre-enable-vhost
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
1
plugins/20_events/user-auth
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||
|
||||
apps_create() {
|
||||
declare desc="verifies app name and creates an app"
|
||||
@@ -34,11 +35,14 @@ apps_destroy() {
|
||||
|
||||
plugn trigger pre-delete "$APP" "$IMAGE_TAG"
|
||||
local DOKKU_APP_CIDS=$(get_app_container_ids "$APP")
|
||||
local cid
|
||||
local DOKKU_DOCKER_STOP_TIMEOUT="$(config_get "$APP" DOKKU_DOCKER_STOP_TIMEOUT || true)"
|
||||
[[ $DOKKU_DOCKER_STOP_TIMEOUT ]] && DOCKER_STOP_TIME_ARG="--time=${DOKKU_DOCKER_STOP_TIMEOUT}"
|
||||
|
||||
if [[ -n $DOKKU_APP_CIDS ]]; then
|
||||
local cid
|
||||
for cid in $DOKKU_APP_CIDS; do
|
||||
docker stop "$cid" > /dev/null || true
|
||||
# shellcheck disable=SC2086
|
||||
docker stop $DOCKER_STOP_TIME_ARG "$cid" > /dev/null || true
|
||||
docker rm "$cid" > /dev/null || true
|
||||
done
|
||||
fi
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core apps plugin"
|
||||
version = "0.5.3"
|
||||
version = "0.6.4"
|
||||
[plugin.config]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core build-env plugin"
|
||||
version = "0.5.3"
|
||||
version = "0.6.4"
|
||||
[plugin.config]
|
||||
|
||||
@@ -7,13 +7,14 @@ case "$1" in
|
||||
help_content_func () {
|
||||
declare desc="return certs plugin help content"
|
||||
cat<<help_content
|
||||
certs, Manage Dokku apps SSL (TLS) certs
|
||||
certs:add <app> CRT KEY, Add an ssl endpoint to an app. Can also import from a tarball on stdin
|
||||
certs:chain CRT [CRT ...], [NOT IMPLEMENTED] Print the ordered and complete chain for the given certificate.
|
||||
certs:chain CRT [CRT ...], [NOT IMPLEMENTED] Print the ordered and complete chain for the given certificate
|
||||
certs:generate <app> DOMAIN, Generate a key and certificate signing request (and self-signed certificate)
|
||||
certs:info <app>, Show certificate information for an ssl endpoint.
|
||||
certs:key <app> CRT KEY [KEY ...], [NOT IMPLEMENTED] Print the correct key for the given certificate.
|
||||
certs:remove <app>, Remove an SSL Endpoint from an app.
|
||||
certs:rollback <app>, [NOT IMPLEMENTED] Rollback an SSL Endpoint for an app.
|
||||
certs:info <app>, Show certificate information for an ssl endpoint
|
||||
certs:key <app> CRT KEY [KEY ...], [NOT IMPLEMENTED] Print the correct key for the given certificate
|
||||
certs:remove <app>, Remove an SSL Endpoint from an app
|
||||
certs:rollback <app>, [NOT IMPLEMENTED] Rollback an SSL Endpoint for an app
|
||||
certs:update <app> CRT KEY, Update an SSL Endpoint on an app. Can also import from a tarball on stdin
|
||||
help_content
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[plugin]
|
||||
description = "dokku core certificate management plugin"
|
||||
version = "0.5.3"
|
||||
version = "0.6.4"
|
||||
[plugin.config]
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/certs/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions"
|
||||
|
||||
is_tar_import() {
|
||||
declare desc="determines if we have STDIN open in an attempt to detect a streamed tar import"
|
||||
@@ -35,9 +34,12 @@ certs_set() {
|
||||
verify_app_name "$2"
|
||||
local APP="$2"; local CRT_FILE="$3"; local KEY_FILE="$4"; local APP_SSL_PATH="$DOKKU_ROOT/$APP/tls"
|
||||
|
||||
is_file_import "$CRT_FILE" "$KEY_FILE" || is_tar_import || dokku_log_fail "Tar archive containing server.crt and server.key expected on stdin"
|
||||
|
||||
if is_tar_import; then
|
||||
if is_file_import "$CRT_FILE" "$KEY_FILE"; then
|
||||
# importing from file
|
||||
true
|
||||
|
||||
elif is_tar_import; then
|
||||
local CERTS_SET_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku_certs_set.XXXX")
|
||||
pushd "$CERTS_SET_TMP_WORK_DIR" &> /dev/null
|
||||
trap 'popd &> /dev/null || true; rm -rf $CERTS_SET_TMP_WORK_DIR > /dev/null' RETURN
|
||||
@@ -62,6 +64,10 @@ certs_set() {
|
||||
else
|
||||
local KEY_FILE=$KEY_FILE_SEARCH
|
||||
fi
|
||||
|
||||
else
|
||||
dokku_log_fail "Tar archive containing server.crt and server.key expected on stdin"
|
||||
|
||||
fi
|
||||
|
||||
mkdir -p "$APP_SSL_PATH"
|
||||
@@ -70,7 +76,8 @@ certs_set() {
|
||||
chmod 750 "$APP_SSL_PATH"
|
||||
chmod 640 "$APP_SSL_PATH/server.crt" "$APP_SSL_PATH/server.key"
|
||||
cd "$DOKKU_ROOT"
|
||||
nginx_build_config "$APP"
|
||||
plugn trigger post-certs-update "$APP"
|
||||
plugn trigger post-domains-update "$APP"
|
||||
}
|
||||
|
||||
certs_set "$@"
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions"
|
||||
|
||||
certs_generate_cmd() {
|
||||
declare desc="generates a self-signed SSL certificate/key combo"
|
||||
@@ -26,7 +25,7 @@ certs_generate_cmd() {
|
||||
mv -f "$CERTS_GENERATE_TMP_WORK_DIR/server.key" "$CERTS_GENERATE_TMP_WORK_DIR/server.crt" "$APP_SSL_PATH"
|
||||
chmod 750 "$APP_SSL_PATH"
|
||||
chmod 640 "$APP_SSL_PATH/server.key" "$APP_SSL_PATH/server.crt"
|
||||
[[ -n "$DOMAIN" ]] && (domains_add "$APP" "$DOMAIN" || nginx_build_config "$APP")
|
||||
[[ -n "$DOMAIN" ]] && (domains_add "$APP" "$DOMAIN" || plugn trigger post-domains-update "$APP")
|
||||
dokku_log_info1 "The following is a certificate signing request that can be used"
|
||||
dokku_log_info1 "to generate an 'officially' signed SSL certificate for $APP at $DOMAIN"
|
||||
dokku_log_info1 "by a CA of your choosing."
|
||||
|
||||
@@ -12,6 +12,7 @@ certs_remove_cmd() {
|
||||
if [[ -d "$APP_SSL_PATH" ]]; then
|
||||
dokku_log_info1 "Removing SSL endpoint from $APP"
|
||||
rm -rf "$APP_SSL_PATH"
|
||||
plugn trigger post-certs-remove "$APP"
|
||||
plugn trigger post-domains-update "$APP"
|
||||
else
|
||||
dokku_log_fail "An app-specific SSL endpoint is not defined"
|
||||
|
||||
@@ -58,8 +58,8 @@ checks_check_deploy() {
|
||||
eval "$(config_export global)"
|
||||
eval "$(config_export app "$APP")"
|
||||
|
||||
if [[ "$(is_app_checks_enabled "$APP")" == "false" ]]; then
|
||||
dokku_log_info2_quiet "Zero downtime checks for app ($APP) have been disabled. moving on..."
|
||||
if [[ "$(is_app_proctype_checks_skipped "$APP" "$DOKKU_APP_CONTAINER_TYPE")" == "true" ]]; then
|
||||
dokku_log_info2_quiet "Zero downtime checks for app ($APP) have been skipped. moving on..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@ -131,8 +131,8 @@ checks_check_deploy() {
|
||||
line=$(strip_inline_comments "$line")
|
||||
# Name/value pair
|
||||
if [[ "$line" =~ ^.+= ]]; then
|
||||
NAME=${TRIM%=*}
|
||||
VALUE=${TRIM#*=}
|
||||
NAME=${line%=*}
|
||||
VALUE=${line#*=}
|
||||
[[ "$NAME" = "WAIT" ]] && local WAIT=$VALUE
|
||||
[[ "$NAME" = "TIMEOUT" ]] && local TIMEOUT=$VALUE
|
||||
[[ "$NAME" = "ATTEMPTS" ]] && local ATTEMPTS=$VALUE
|
||||
@@ -156,8 +156,8 @@ checks_check_deploy() {
|
||||
local CURL_OPTIONS="-q --compressed --fail --location --max-time $TIMEOUT"
|
||||
|
||||
# Set X-Forwarded-Proto header if TLS is enabled.
|
||||
local SSL="$DOKKU_ROOT/$APP/tls"; local 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
|
||||
local SSL="$DOKKU_ROOT/$APP/tls"
|
||||
if [[ -e "$SSL/server.crt" && -e "$SSL/server.key" ]]; then
|
||||
local CURL_OPTIONS+=" -H X-Forwarded-Proto:https"
|
||||
fi
|
||||
|
||||
|
||||
@@ -8,15 +8,16 @@ case "$1" in
|
||||
declare desc="return checks plugin help content"
|
||||
cat<<help_content
|
||||
checks <app>, Show zero-downtime status
|
||||
checks:enable <app>, Enable zero-downtime checks
|
||||
checks:disable <app>, Disable zero-downtime checks
|
||||
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)
|
||||
help_content
|
||||
}
|
||||
|
||||
if [[ $1 = "checks:help" ]] ; then
|
||||
echo -e 'Usage: dokku checks[:COMAND]'
|
||||
echo ''
|
||||
echo 'Manage zero-downtime checks.'
|
||||
echo 'Manage zero-downtime settings.'
|
||||
echo ''
|
||||
echo 'Additional commands:'
|
||||
help_content_func | sort | column -c2 -t -s,
|
||||
|
||||
@@ -3,15 +3,27 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||
|
||||
is_app_checks_enabled() {
|
||||
declare desc="return app zero-downtime checks status"
|
||||
is_app_proctype_checks_disabled() {
|
||||
declare desc="return true if app's proctype(s) checks are disabled"
|
||||
local APP="$1"; verify_app_name "$APP"
|
||||
local DOKKU_CHECKS_ENABLED=$(config_get "$APP" DOKKU_CHECKS_ENABLED)
|
||||
local PROCTYPE="$2" status=false
|
||||
local DOKKU_CHECKS_DISABLED=$(config_get "$APP" DOKKU_CHECKS_DISABLED || true)
|
||||
|
||||
if [[ -z "$DOKKU_CHECKS_ENABLED" ]] || [[ "$DOKKU_CHECKS_ENABLED" == "1" ]];then
|
||||
local status=true
|
||||
else
|
||||
local status=false
|
||||
if [[ "$DOKKU_CHECKS_DISABLED" == "_all_" ]] || [[ "$(is_val_in_list "$PROCTYPE" "$DOKKU_CHECKS_DISABLED")" == "true" ]] ;then
|
||||
status=true
|
||||
fi
|
||||
|
||||
echo $status
|
||||
}
|
||||
|
||||
is_app_proctype_checks_skipped() {
|
||||
declare desc="return true if app's proctype(s) checks are skipped"
|
||||
local APP="$1"; verify_app_name "$APP"
|
||||
local PROCTYPE="$2" status=false
|
||||
local DOKKU_CHECKS_SKIPPED=$(config_get "$APP" DOKKU_CHECKS_SKIPPED || true)
|
||||
|
||||
if [[ "$DOKKU_CHECKS_SKIPPED" == "_all_" ]] || [[ "$(is_val_in_list "$PROCTYPE" "$DOKKU_CHECKS_SKIPPED")" == "true" ]] ;then
|
||||
status=true
|
||||
fi
|
||||
|
||||
echo $status
|
||||
|
||||