Docker Swarm, Compose and PostgreSQL

I’m attempting to run a containerized application that relies on a postgres database. I am using Swarm and docker-compose to manage it.

I manually create a volume against a host that is part of the Swarm cluster ( docker volume create --name=my_data ) and use this volume in my compose file. I say in the compose file that the volume is external.

  • Install cURL compiled with OpenSSL and zlib in Dockerfile
  • Use environment variables in docker
  • Extend docker devicemapper loop-lvm sparse file
  • Setting PYTHONPATH in Ubuntu 16.04 for a Docker image to run properly
  • Reverse proxy nginx and Express server returning 502
  • Chronos scheduler, deploy on every nodes
  • I find that when the container starts the data volume and the postgres application are not necessarily co-located. If they are not co-located, docker seems to create me a new volume.

    A little further reading has lead me to believe that I should be looking at volume plugins such as Flocker. If I want to achieve persistent data for swarm applications using a database, is it best practice to use a volume plugin like this?

    My compose file …

    version: '2'
          image : ui
           - 8080:8080
           ADDRESS_SERVICE_URI: http://camel:8091
          image : camel
           - 18081:8081
           - 18091:8091
           - 8081
           - 8091
          image: postgres:9.4.5
           - app1_address_data:/var/lib/postgresql/data
          external: true
           name: my-net

  • REPLICAS remains 0 after running `docker stack deploy` command in manager machine
  • Docker Compose raise an AccessDeniedExpcetion
  • How can I debug php mounted to a container running on docker beta for mac
  • Error: Module did not self register
  • Bluemix Docker Container cf ic login the local Docker daemon is not reachable to authenticate
  • Vagrant with Docker provider does not share folders
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.