简体   繁体   中英

multiple docker containers not exposed using port?

I have created a docker-compose.yml that brings up 2 linked container, when using the same file in another directory using docker-compose up command considering the changing exposed port, it brings up the first container, but other container is not accessible even they are showing up and running when running docker -ps

version: '2.0'
services:
  web:
    image: myodoo8
    depends_on:
      - db
    volumes:
      - o1-web-data:/var/lib/odoo
      - ./config:/etc/odoo
      - ./addons:/mnt/extra-addons
    ports:
      - "8069:8069"
    links:
      - db
  db:
    image: postgres:9.4
    environment:
      - POSTGRES_PASSWORD=odoo
      - POSTGRES_USER=odoo
      - POSTGRES_DB=odoo
      - PGDATA=/var/lib/postgresql/data/pgdata
    volumes:
      - ./o1-db-data:/var/lib/postgresql/data/pgdata
      - ./backups:/var/backups


volumes:
  o1-web-data:
  o1-db-data:

Shouldn't it have this?-

ports:
      - "8069:8069"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM