tag postgres image used in docker-compose?

  docker, docker-compose, postgresql, tags

I have the following docker-compose file:

version: "3.7"

services:
  bejebeje-identity:
    build:
      context: ./Bejebeje.Identity
      labels:
        com.bejebeje.description: "Bejebeje's Identity Server"
    image: bejebeje/identity:latest
    ports:
      - "5006:443"
      - "5005:80"
    env_file:
      - ./variables.env
    depends_on:
      - database
    volumes:
      - ~/.aspnet/https:/root/.aspnet/https/
  database:
    image: postgres:13.0
    ports:
      - "8001:5432"
    volumes:
      - data-volume:/var/lib/postgresql/data
    env_file:
      - ./variables.env

volumes:
  data-volume:

When I run docker-compose build . the images are built, I then run docker image ls and I get:

docker image ls

I suspect the <none> image is the postgres database? In my docker-compose file, how can I tag the database image with something like database/bejebeje/identity?

Source: Docker Questions

LEAVE A COMMENT