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?

More than 1 year has passed since last update.

docker composeのメモ

Posted at

visual studio codeのおすすめプラグイン
・Docker

web apiサーバーを作成するdocker-compose

実行UPコマンド
docker compose up

実行DOWNコマンド
docker compose down

実行UPコマンド(イメージを作り直す)
docker compose up --build

docker-compose.yml

version: '3.9'
services:
  api:
    build: ./api
    ports:
      -8080:8080
    depends_on:
      - db
  db:
    image: postgres:15
    port:
      - 5432:5432
    enviroment:
      - POSTGRES_PASSWORD=mypassword
      - POSTGRES_USER=postgres
      - POSTGRES_DB=appdb
    volumes:
      - db-storage:/bar/lib/postgresql/data
      - ./db/initdb:/docker-entrypoint-initdb.d

volumes:
  db-storage: 

      
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?