Вот содержимое файла docker-compose.yml для создания образа базы данных.
version: '2'
services:
myerp.db:
image: postgres:10
Когда я запускаю команду docker-compose, я получаю:
Pulling myerp.db (postgres:10)...
10: Pulling from library/postgres
802b00ed6f79: Already exists
4e0de21e2180: Already exists
58b06ac4cd84: Already exists
14e76b354b47: Already exists
0f0c9f244b65: Already exists
37117d8abb6d: Already exists
8b541f5d818a: Already exists
7cb4855fcd96: Already exists
5c7fe264586b: Already exists
64568a495c35: Already exists
283257efa745: Already exists
222b134fa51d: Already exists
e9a30e7f2a9f: Already exists
86bffc7855b0: Already exists
Digest: sha256:1d26fae6c056760ed5aa5bb5d65d155848f48046ae8cd95c5b26ea7ceabb37ad
Status: Downloaded newer image for postgres:10
Starting dev_myerp.db_1 ... done
Attaching to dev_myerp.db_1
myerp.db_1 | 2018-09-23 10:27:38.647 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
myerp.db_1 | 2018-09-23 10:27:38.647 UTC [1] LOG: listening on IPv6 address "::", port 5432
myerp.db_1 | 2018-09-23 10:27:38.653 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
myerp.db_1 | 2018-09-23 10:27:38.682 UTC [21] LOG: database system was shut down at 2018-09-23 10:16:13 UTC
myerp.db_1 | 2018-09-23 10:27:38.708 UTC [1] LOG: database system is ready to accept connections
Я замечаю, что когда я добавляю эти строки в docker-compose.yml:
ports:
- "127.0.0.1:9432:5433"
volumes:
# - "./data/db:/var/lib/postgresql/data"
- "./init/db/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d"
environment:
- POSTGRES_DB=db_myerp
- POSTGRES_USER=user
- POSTGRES_PASSWORD=usr
, у меня всегда "0.0.0.0" вместо 127.0.0.1.
Attaching to dev_myerp.db_1
myerp.db_1 | 2018-09-23 10:27:38.647 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
myerp.db_1 | 2018-09-23 10:27:38.647 UTC [1] LOG: listening on IPv6 address "::", port 5432
myerp.db_1 | 2018-09-23 10:27:38.653 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
myerp.db_1 | 2018-09-23 10:27:38.682 UTC [21] LOG: database system was shut down at 2018-09-23 10:16:13 UTC
myerp.db_1 | 2018-09-23 10:27:38.708 UTC [1] LOG: database system is ready to accept connections
Пожалуйста, Можете ли вы объяснить мне, почему информация, добавленная в файл, не принимается во внимание?
Заранее спасибо