version: '3.4'

volumes:
  postgresql:
  media:
services:
  web_prod:
    restart: always
    build:
      context: .
      dockerfile: Dockerfile.prod
    env_file: .env.prod
    volumes:
      - type: volume
        source: media
        target: /app/media
        volume:
          nocopy: true
    ports:
      - 8080:8080
    stdin_open: true
    tty: true
    depends_on:
      - db
  db_prod:
    restart: always
    image: postgres:11
    ports:
      - 5432:5432
    volumes:
      - postgresql:/var/lib/postgresql/data
    env_file: .env.prod

version: '3.4'

volumes:
  postgresql:
  media:
services:
  web_prod:
    restart: always
    build:
      context: .
      dockerfile: Dockerfile.prod
    env_file: .env.prod
    volumes:
      - type: volume
        source: media
        target: /app/media
        volume:
          nocopy: true
    ports:
      - 8080:8080
    stdin_open: true
    tty: true
    depends_on:
      - db_prod
  db_prod:
    restart: always
    image: postgres:11
    ports:
      - 5432:5432
    volumes:
      - postgresql:/var/lib/postgresql/data
    env_file: .env.prod

Update service name in depends_on
Update service name in depends_on
