version: "3"
services:
  postgres:
    image: postgres:9.6
    environment:
      POSTGRES_DB: cargo_registry
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: password
    ports:
      - 5432:5432
    volumes:
      - postgres-data:/var/lib/postgresql/data
  backend:
    build:
      context: .
      dockerfile: backend.Dockerfile
    environment:
      DEV_DOCKER: "true"
      DATABASE_URL: postgres://postgres:password@postgres/cargo_registry
      SESSION_KEY: badkeyabcdefghijklmnopqrstuvwxyzabcdef
      GIT_REPO_URL: file://./tmp/index-bare
      GH_CLIENT_ID: ""
      GH_CLIENT_SECRET: ""
      WEB_ALLOWED_ORIGINS: http://localhost:8888,http://localhost:4200
    links:
      - postgres
    ports:
      - 8888:8888
    volumes:
      # Mount the src/ directory so we don't have to rebuild the Docker image
      # when we want to change some code
      - ./src:/app/src:ro

      - index:/app/tmp
      - cargo-cache:/usr/local/cargo/registry
      - target-cache:/app/target
  frontend:
    build:
      context: .
      dockerfile: frontend.Dockerfile
    entrypoint: yarn start -- --proxy http://backend:8888
    links:
      - backend
    ports:
      - 4200:4200
    volumes:
      # Mount the app/ directory so live reload works
      - ./app:/app/app:ro

volumes:
  postgres-data:
  cargo-cache:
  target-cache:
  index:

version: "3"

services:
  postgres:
    image: postgres:9.6
    environment:
      POSTGRES_DB: cargo_registry
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: password
    ports:
      - 5432:5432
    volumes:
      - postgres-data:/var/lib/postgresql/data

  backend:
    build:
      context: .
      dockerfile: backend.Dockerfile
    environment:
      DEV_DOCKER: "true"
      DATABASE_URL: postgres://postgres:password@postgres/cargo_registry
      SESSION_KEY: badkeyabcdefghijklmnopqrstuvwxyzabcdef
      GIT_REPO_URL: file://./tmp/index-bare
      GH_CLIENT_ID: ""
      GH_CLIENT_SECRET: ""
      WEB_ALLOWED_ORIGINS: http://localhost:8888,http://localhost:4200
    links:
      - postgres
    ports:
      - 8888:8888
    volumes:
      # Mount the src/ directory so we don't have to rebuild the Docker image
      # when we want to change some code
      - ./src:/app/src:ro

      - index:/app/tmp
      - cargo-cache:/usr/local/cargo/registry
      - target-cache:/app/target

  frontend:
    build:
      context: .
      dockerfile: frontend.Dockerfile
    entrypoint: yarn start -- --proxy http://backend:8888
    links:
      - backend
    ports:
      - 4200:4200
    volumes:
      # Mount the app/ directory so live reload works
      - ./app:/app/app:ro

volumes:
  postgres-data:
  cargo-cache:
  target-cache:
  index:

Add blank lines between services
docker: Add blank lines between services

to make the file a bit easier on the eyes ;)
