Here is Docker file that will build image for our example.
Docker Compose
For development, we can simplify development using docker-compose. It will prepare our, for example, local development environment.
We use three different images: postgres, redis and mobydock. Docker compose will make sure there is PostgreSQL and Redis databases. And it also maps our source code to docker so changes will be available immediately.
environment variables are used by a docker container, for example, postgres container expects POSTGRES_USER and POSTGRES_PASSWORD
volumes will bind our local code to docker, so we will be able to see our changes immediately in docker container, that is very useful for local development
links make dependencies inside docker compose files
After we have the docker compose file, we can start it all up.
Sometimes, we kill docker-compose with Ctrl+C it hands and we need to kill the instances: docker-compose stop