version: '3.3'
services:
  postgres:
    image: postgres:9.3
    restart: always
    ports:
      - 5432
    environment:
      - PGDATA=/var/lib/postgresql/data
      - POSTGRES_PASSWORD=
      - POSTGRES_DB=test_hodor
  rabbitmq:
    build:
      context: .
      dockerfile: docker/rabbitmq/Dockerfile
    restart: always
    ports:
      - 5672
      - 15672
    hostname: rabbitmq
  php:
    build:
      context: .
      dockerfile: docker/php/Dockerfile
    volumes:
      - .:/hodor
      - ~/.composer/:/.composer
    depends_on:
      - postgres
      - rabbitmq

version: '3.3'
services:
  postgres:
    image: postgres:9.3
    restart: always
    ports:
      - 5432
    environment:
      - PGDATA=/var/lib/postgresql/data
      - POSTGRES_PASSWORD=
      - POSTGRES_DB=test_hodor
  rabbitmq:
    build:
      context: .
      dockerfile: docker/rabbitmq/Dockerfile
    restart: always
    ports:
      - 5672
      - 15672
    hostname: rabbitmq
  php:
    build:
      context: .
      dockerfile: docker/php/Dockerfile
    volumes:
      - .:/hodor
      - ~/.composer/:/root/.composer
    depends_on:
      - postgres
      - rabbitmq

Maintain composer cache outside of container
Maintain composer cache outside of container

The composer cache volume was mapped to the wrong directory on the
docker container, so the cache was being lost when the container was
destroyed.
