Score:0

What's wrong in my docker file - services.db.environment must be a mapping

pn flag

Here's my yml contents.


version: '2.2'

services:

  # postgres
  # https://hub.docker.com/_/postgres
  db:
    container_name: postgres
    platform : linux/amd64
    image: "postgres:14.6-alpine"
    restart: always
    environment:
      POSTGRES_USER={###}
      POSTGRES_PASSWORD={###}
      POSTGRES_DB={###}
    volumes:
      - db_data:/users/a/documents/docker_db/
    networks:
      - service
    ports:
      - "5432:5432"
 # Container Deployment
   #https://www.pgadmin.org/docs/pgadmin4/6.10/container_deployment.html
  # https://hub.docker.com/r/dpage/pgadmin4/
  pgadmin:
    platform : linux/amd64
    container_name: pgadmin4_container
    image: dpage/pgadmin4
    restart: always
    environment:
     -  [email protected]
     -  PGADMIN_DEFAULT_PASSWORD=admin
    depends_on:
      - db
    networks:
      - service
    ports:
      - "80:80"

volumes:
  db_data: {}

error message : services.db.environment must be a mapping I'm using the Mac M1 And I have no idea what is wrong .... Does anyone know ??

Score:0
in flag

you are missing the -, you are doing it correct in the pgadmin container

    environment:
      - POSTGRES_USER={###}
      - POSTGRES_PASSWORD={###}
      - POSTGRES_DB={###}
yeonsook kwak avatar
pn flag
It was not only because of the missing - . Actually I was forgotten to write network . ``` networks: service: driver: bridge ```
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.