数据库,用户不是使用postgres docker-compose创build的
我正在设置我的django项目和postgres,但每次我得到这个错误
angular色不存在
要么
Db不存在
所以当我只试图设置postgres,看看postgres是否正确创build用户和数据库,但事实并非如此
这是我的docker撰写文件:
version: "3" services: templates_db: image: postgres:9.6 ports: - "5432:5432" environment: - POSTGRES_USER=my_user - POSTGRES_PASSWORD=my_pass - POSTGRES_DB=my_db volumes: - ./data/postgres:/var/lib/postgresql/data
我使用docker-compose up --build
运行我的撰写文件docker-compose up --build
并得到了以下日志
templates_db_1 | LOG: database system was interrupted; last known up at 2017-05-16 05:48:39 UTC templates_db_1 | LOG: database system was not properly shut down; automatic recovery in progress templates_db_1 | LOG: invalid record length at 0/14F0080: wanted 24, got 0 templates_db_1 | LOG: redo is not required templates_db_1 | LOG: MultiXact member wraparound protections are now enabled templates_db_1 | LOG: database system is ready to accept connections templates_db_1 | LOG: autovacuum launcher started
-
当我login到postgresshell
docker exec -it **container_id** sh su - postgres $ psql postgres=# \l
它没有我在合成文件my_db中提到的分贝