PerlDancer / Dancer2

Perl Dancer Next Generation (rewrite of Perl Dancer)
http://perldancer.org/
Other
542 stars 274 forks source link

Generate a Dockerfile when creating a new app #1614

Closed cromedome closed 3 years ago

cromedome commented 3 years ago

This is the same PR as #1589 with the same features and syntax, just reimplemented for the new CLI.

veryrusty commented 3 years ago

I wonder if the instructions on how to run it via Docker should mention that the -p 5000:5000 arg is the port inside Docker and the port it's exposed as

Note that -p x:y implies x is the locally exposed port, y is the port used within the running container. Using different values for x and y makes it clearer.

Or, maybe, we should have a Dancer2::Manual::Docker or similar, or just a new section in Dancer2::Manual::Deployment, which could start out quite simple for now, and have it refer to that for more information on running D2 apps via Docker?

This is a can of worms I don't want to open. There are many way to deploy docker apps that we couldn't possibly cover them all. Some external links to docker deployment examples would be better than writing it ourselves.

cromedome commented 3 years ago

@veryrusty If you have any resources you like in particular, please share and I can add them to the deployment manual. I think that's a better way to go than to try and write something ourselves.

cromedome commented 3 years ago

I changed the port the app runs on inside the container to highlight the difference between the internal and external ports. The output of the generation now points this out.

veryrusty commented 3 years ago

Also, I have no specific references to link to for Docker deployment docs. Once your image is built, deployment is not Dancer2 or Perl specific. Google will be a more up-to-date reference that anything we could document.

cromedome commented 3 years ago

Merged. Thanks everyone!