当前位置:Gxlcms > 数据库问题 > [DevOps] Set up and run a PostgreSQL instance locally with Docker Compose

[DevOps] Set up and run a PostgreSQL instance locally with Docker Compose

时间:2021-07-01 10:21:17 帮助过:14人阅读

"postgres:12" ports: - "54320:5432" volumes: - ./pgdata:/var/lib/postgresql/data environment: - POSTGRES_USER=alice - POSTGRES_PASSWORD=wonderland - POSTGRES_DB=myawesomedb

 

 

# Up and Running

docker-compose -d

# Check Whether contain is running

docker-compose ps

# enter the shell

docker-compose run db bash

## Verify db exist

poql --host=db --username=alice --dbname=myawesomedb

## Esc the db

Ctrl + d twice

# Off

docker-compose down

 

[DevOps] Set up and run a PostgreSQL instance locally with Docker Compose

标签:sage   project   learn   volumes   ESS   lex   The   DBName   instance   

人气教程排行