5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

postgresがGUIで見れるpgwebを一瞬で構築するdocker-composeの書き方

Last updated at Posted at 2020-04-02

postgresがGUIで見れるpgwebを一瞬で構築するdocker-composeの書き方です。

データベースをGUIで見たいことや、見たいと言われることありますよね?

postgresでdockerさえあればpgwebを使用してインストール不要でブラウザでGUIを用意できます。

しかもdocker-compose.ymlさえあれば、docker-compose build,docker-compose upして
localhost:8080にアクセスするだけ。

超お手軽です!

今回はcloud9で見れるように、cloud9デフォルトポートの8080に割り当てています。

version: "3"
services:
  pgweb:
    image: sosedoff/pgweb
    ports:
      - "8080:8081"
    environment:
      PGWEB_DATABASE_URL: postgres://postgres:pgweb@db:5432/postgres?sslmode=disable
    depends_on:
      - db
  db:
    image: postgres:11.1-alpine
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: pgweb
    ports:
      - "5432:5432"
    volumes:
      - "./postgres-data:/var/lib/postgresql/data"

Screenshot from 2020-04-03 00-09-31.png

5
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?