Hi Jared,
I've had a look into this for one of my projects. Here's what I did:
I've created a docker base image for Wagtail projects (it's Ubuntu 14.04 with wagtails dependencies installed):
https://registry.hub.docker.com/u/kaedroho/wagtail-base/I then created a Dockerfile for my project which uses the above base image. It installs uwsgi, then adds the code then installs my projects' dependencies. Here's a stripped down version of it:
https://gist.github.com/kaedroho/5920ddf6751e7c7c5812And here's the uwsgi.ini that I'm using:
https://gist.github.com/kaedroho/35d69097ff724740692eAlso, in my production settings file, I added some database configuration which picks up the location of the PostgreSQL server from the environment variables that Docker passes to it. You might want to do the same for Elasticsearch/Redis as well:
https://gist.github.com/kaedroho/356c374fc33e6e5e5facHere's where it gets a bit tricky... Running migrations and collecting/compressing static files. Here's what I did:
Firstly, build the docker image and tag it:
# in the folder with the Dockerfile
$ docker build -t mysite .
You may need to get a cup of coffee as this takes a couple of minutes (later builds would be faster as some steps get cached).
Once it's built, run it and link it to your postgres box:
$ docker run -d --name mysite-container --link postgres-container:postgres -p 80:80 mysite
You should now be able to browse to the site and see a big fat error message.
To migrate, first make sure you have the database/user setup in postgres (see:
https://registry.hub.docker.com/_/postgres/)
Then, run the following:
$ docker run -ti --link postgres-container:postgres mysite python manage.py syncdb
$ docker run -ti --link postgres-container:postgres mysite python manage.py migrate
Then finally, you have to collect and compress static files, don't forget the "volumes from" bit:
$ docker run -ti --volumes-from mysite-container --link postgres-container:postgres mysite python manage.py collectstatic
$ docker run -ti --volumes-from mysite-container --link postgres-container:postgres mysite python manage.py compress
Hopefully, that will work for you. Most of those docker commands would have to be rerun on every deploy so it might be worth creating a fabfile for it all (which I haven't got round to yet!)
Thanks,
Karl