这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@michaelshobbs
Copy link
Member

This is a work in progress, PLEASE DO NOT MERGE. I wanted to get this up for initial feedback. The following checklist will show current progress. Please pick this apart!

  • refactor into functions where possible; reduce global variables. needed access to some other plugin functionality, so I did this in those plugins as well
  • genericize enable/disable proxy and port variables
  • create proxy plugin
  • support proxy with no domains attached
  • install sigil via Makefile
  • remove magic NO_VHOST variable. explicitly use domains:disable/domains:enable
  • install sigil via package
  • re-implement nginx config template using sigil
  • drop server-wide ssl certs
  • add UI to manage global vhost
  • with an ssl-enabled app, redirect all configured domains to 443
  • show warning if no configured domains are contained in the SSL certificate details
  • add ability to disable zero-downtime per app (added commands to checks plugin)
  • support multiple exposed ports for dockerfile apps
  • unify on one custom template name (nginx.conf.sigil)
  • only look for nginx template in app and discard after deploy (allows easy revert to default template)
  • look for custom template in /app or WORKDIR
  • usage docs
  • migration docs

open questions:

  • if we see a dockerfile with udp port exposures, do we automatically disable proxy or do we just leave it to the user? we will leave this to the user. the nginx-vhosts plugin will ignore udp ports. however, a different proxy implementation (haproxy perhaps) could be made to do this.
  • user configurable upstreams (this can be done with a custom template or we could add an include dir similar to this include {{ .DOKKU_ROOT }}/{{ .APP }}/nginx.conf.d/*.conf; this can be handled via a custom template now

closes #1629

@josegonzalez
Copy link
Member

Can we list the udp and tcp ports separately? And pass them in somehow to the enabled proxy plugin. That way the plugin can do as it wants.

I think we disable the proxy plugin and treat it like a background app for our nginx implementation. Nothing else we can do anyhow.

@michaelshobbs michaelshobbs force-pushed the mh-nginx-vhosts-rewrite branch from c5966bf to dd9adb1 Compare January 29, 2016 23:10
@michaelshobbs
Copy link
Member Author

@josegonzalez I'm not clear on the context of your two sections there. Can you clarify please?

@josegonzalez
Copy link
Member

if we see a dockerfile with udp port exposures, do we automatically disable proxy or do we just leave it to the user?

@michaelshobbs
Copy link
Member Author

Ah ok. Haven't even touched dockerfile stuff yet but I play around with some test deploys and report back.

@michaelshobbs michaelshobbs force-pushed the mh-nginx-vhosts-rewrite branch 8 times, most recently from bcac7a1 to b9c8f71 Compare February 5, 2016 23:30
@michaelshobbs michaelshobbs force-pushed the mh-nginx-vhosts-rewrite branch 6 times, most recently from e98dbf7 to edd958d Compare February 6, 2016 05:50
@michaelshobbs michaelshobbs force-pushed the mh-nginx-vhosts-rewrite branch from edd958d to 56e1527 Compare February 10, 2016 00:35
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_CORE_AVAILABLE_PATH/proxy/functions"

get_app_urls() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we consolidate the common and 00_dokku-standard plugins?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably.

@josegonzalez
Copy link
Member

Disable the proxy == no zero-downtime. Ports just change. Want a light-weight way of having the same ports without the overhead of nginx or haproxy? Create a proxy plugin that does it via iptables.

I don't particularly like the idea of:

  • check if new container passes checks.
  • turn off all existing containers.
  • start the new ones.

Sounds risky, people will complain that their apps don't work, and will be a mess to keep track of.

@u2mejc
Copy link
Contributor

u2mejc commented Feb 13, 2016

I mean it was a "feature" of dokku years ago if there was port collision, the old container was simply shut down first. But I'll defer to you guys since I don't utilize the use case, so I have not vested interest.

@josegonzalez
Copy link
Member

Do you have docs for that feature?

@michaelshobbs michaelshobbs force-pushed the mh-nginx-vhosts-rewrite branch from 76a5d5d to 0fb63b7 Compare February 13, 2016 02:00
@michaelshobbs
Copy link
Member Author

Fixed get_app_urls() for non-proxied dockerfile apps with exposed ports.

This dockerfile

FROM node:4

EXPOSE 3001/udp
EXPOSE  3000/tcp
EXPOSE 3003

COPY . /app
WORKDIR /app
RUN npm install

CMD npm start

Yields these URLS:

dokku.me:32779->3000/tcp (container)
dokku.me:32773->3001/udp (container)
dokku.me:32778->3003/tcp (container)

@michaelshobbs michaelshobbs changed the title [WIP] nginx-vhosts rewrite nginx-vhosts rewrite Feb 15, 2016
@michaelshobbs
Copy link
Member Author

Please let me know if I missed anything here

@michaelshobbs michaelshobbs force-pushed the mh-nginx-vhosts-rewrite branch from 7f750bf to d8b94f1 Compare February 15, 2016 02:43
@u2mejc
Copy link
Contributor

u2mejc commented Feb 15, 2016

Do you have docs for that feature?

you have to go way back! like here:

dokku/dokku

Line 31 in cf7a2a0

if [[ ! -f "$HOME/$APP/PORT" ]]; then

But I think it's a mute issue.

I'll poke around more today.

@michaelshobbs
Copy link
Member Author

@josegonzalez I'd like to drop the custom template path variable and support it similarly to how we handle the Procfile in #1915

@michaelshobbs michaelshobbs self-assigned this Feb 17, 2016
@josegonzalez
Copy link
Member

What do you mean?

@michaelshobbs
Copy link
Member Author

Meaning we'll search for it in /app or WORKDIR (only in the case of dockerfile apps of course)

@michaelshobbs
Copy link
Member Author

I don't like the additional complexity it adds and we don't support this anywhere else. Additionally there is a community plugin to help store your "dokku-isms" in a subfolder and move them appropriately at deploy time.

https://github.com/mikexstudios/dokku-app-configfiles

@josegonzalez
Copy link
Member

Fine by me, just document it.

@michaelshobbs
Copy link
Member Author

Ah! That plugin is out of date but the point still stands about additional complexity and it being the only place we support this sort of custom pathing. Feels janky.

@michaelshobbs
Copy link
Member Author

@josegonzalez I'll need @pmclanahans's changes to copy_from_image

@michaelshobbs michaelshobbs force-pushed the mh-nginx-vhosts-rewrite branch 2 times, most recently from 8c5b6c6 to 1e6dcff Compare February 17, 2016 20:20
@michaelshobbs michaelshobbs force-pushed the mh-nginx-vhosts-rewrite branch from 1e6dcff to 9842d74 Compare February 19, 2016 02:39
@josegonzalez
Copy link
Member

Time to break any installs of master!

josegonzalez added a commit that referenced this pull request Feb 19, 2016
@josegonzalez josegonzalez merged commit 55a4cb3 into master Feb 19, 2016
@josegonzalez josegonzalez deleted the mh-nginx-vhosts-rewrite branch February 19, 2016 03:56
@MorrisJobke
Copy link
Contributor

@sseemayer This is maybe interesting for the Let's encrypt plugin. I guess the plugin should be ported to the new templating.

@josegonzalez josegonzalez changed the title nginx-vhosts rewrite Refactor nginx proxy plugin to add usage flexibility Mar 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nginx-vhosts expected behaviors

5 participants