version: '2'
services:
    db:
      restart: always
      image: postgres
      environment:
          - POSTGRES_DB=om
          - POSTGRES_USER=om
          - POSTGRES_PASSWORD=om
      ports:
          - "5432:5432"

    web:
      restart: always
      build:
        context: .
      command: sh docker/docker-command.sh
      entrypoint: dockerize -wait tcp://db:5432
      volumes:
        - .:/app
      ports:
        - "8000:8000"
      links:
        - db:db

version: '2'
services:
    db:
      restart: always
      image: postgres
      environment:
          - POSTGRES_DB=om
          - POSTGRES_USER=om
          - POSTGRES_PASSWORD=om
      ports:
          - "5432:5432"
      volumes:
        - pgdata:/var/lib/postgresql/data

    web:
      restart: always
      build:
        context: .
      command: sh docker/docker-command.sh
      entrypoint: dockerize -wait tcp://db:5432
      volumes:
        - .:/app
      ports:
        - "8000:8000"
      links:
        - db:db

volumes:
  pgdata: {}

Add docker volume for postgres container.
Add docker volume for postgres container.
