Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standard website use case examples please #928

Closed
wernight opened this issue Feb 6, 2015 · 7 comments
Closed

Standard website use case examples please #928

wernight opened this issue Feb 6, 2015 · 7 comments

Comments

@wernight
Copy link

wernight commented Feb 6, 2015

Could at least the basics be a bit better covered? The example given is a toy example, not a production example. Problems I find with this example are:

So I'd really wish there could be couple of standard examples for standard simple websites:

  • Nginx + PHP-FPM (using Composer and may be some PHP framework) + MySQL
  • Nginx + uWSGI + Django (using PIP requirements.txt) + PostgreSQL
  • Nginx + NodeJS + MongoDB

Those example should allow simple development (edit file and reload page), build (run tests), deploy for production (restart services, multiple processes, safe...), and backup DB.

Note: I've done that for the first two cases by mounting volumes as it's a lot faster to develop (and deploy) than using ADD . /code, however I agree that it's less clean and my solution makes it hard to have development build and run tests without impacting deployed Dockers using the same fig.yml.

Related to this is a thread on single vs multi-docker, which means often either building like a VM (usually using phusion's buntu or often supervisor which has PID 1 problem) or using Docker like executable that run on your mounted volumes.

My hopes are that Docker Compose (moby/moby#9694 and moby/moby#9459) starts off people with the right foot.

@wernight wernight changed the title Standard use case examples please Standard website use case examples please Feb 6, 2015
@Starefossen
Copy link

Here is our fig.yml config for the Nginx + uWSGI + Django + PostgreSQL scenario you mentioned. As you can see some parts are commented our since Docker Compose doesn't handle different development environment very well.

@wernight
Copy link
Author

wernight commented Feb 6, 2015

@Starefossen Yes it's close to what I've done. I like your command: /bin/true trick for "development utilities containers". Some of those example should be linked on the front page, and should explain how to use them. One issue with yours, and mine, if that if the directory name is the same you'll kill your production server if you fig build. Another is that it doesn't auto-(re)start. Last, but not least, it doesn't explain the cool Nginx trick that can be done with fig port web 80 to have a random valid port to deploy a virtualhost.

@jmlagace
Copy link

jmlagace commented Feb 6, 2015

The /bin/true is nice but if you are to use that trick you are better off using the tianon/true:latest image. That image does not contain any software whatsoever and is lightweight enough for that purpose.

@wernight
Copy link
Author

wernight commented Feb 6, 2015

@jmlagace Yes tianon/true is good for volume-only containers, my point of using the trick is for example to use a Gradle or a PhantomJS container images directly (build/test containers linked to other containers).

@dnephin
Copy link

dnephin commented Feb 6, 2015

I think it would be a good idea to link to more examples. This has come up before with #669

The question of how to make a database container when the table schemas are in code (ex: with django and rails), is asked frequently.

Another django example: readthedocs/readthedocs.org#1133

@dnephin
Copy link

dnephin commented Aug 31, 2015

If anyone has examples they'd like featured, please comment in #1951

@ijc
Copy link

ijc commented Mar 26, 2019

Issue grooming:

https://docs.docker.com/compose/gettingstarted/ has links (at the end) to Django, Wordpress & rails quickstart examples and in general I think the docs/examples story around docker-compose is very different to how it was in 2015. I think we can close this one.

@ijc ijc closed this as completed Mar 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants