0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

postgreSQLをdockerでコンテナ上げてみる

Posted at

アプリを作成するためpostgreSQLをコンテナで上げよう!の記事です

手順

docker-compose.develop.ymlの作成

version: "3.9"

services:
  db:
    image: postgres:16
    container_name: db-postgres
    restart: always
    ports:
      - "15432:5432"
    environment:
      POSTGRES_USER: XXX
      POSTGRES_PASSWORD: XXX
      POSTGRES_DB: XXX
    volumes:
      - postgres_data:/var/lib/postgresql/data

volumes:
  postgres_data:

イメージを上げるだけなのでdockerfileは不要です

コンテナを上げる

今回はpodman desktopを使用しています(詳しくはhttps://qiita.com/eHZ/items/f682c3cb0984df2996df)

$ podman compose -f docker-compose.develop.yml up -d

A5M2で確認

portは15432ということさえ間違えなければ特段つまずくことはないはずです。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?