1
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?

【Docker】Web→API→DBサーバの作成及びデータ連携【Docker-compose】

Posted at

概要

・Docker-composeファイルを実行し、Web→API→DBサーバの作成の自動化
・Web→API→DBサーバ間のデータ連携の確認

ファイル格納先イメージ

image.png

各ファイルの参照URL

前提条件

・DockerHubのインストールが済んでいること

・Docker Desktopのインストールおよび起動が済んでいること

作業手順

  1. Docker-composeファイルを実行し、Web→API→DBサーバの作成
  2. Web→API→DBサーバ間のデータ連携の確認
  3. コンテナとイメージの削除(後片付け)

Docker-composeファイルを実行し、Web→API→DBサーバの作成

・ターミナルを開き、各ファイルが格納されてあるcontainerディレクトリまで移動
・下記コマンド実行

docker compose up -d

・イメージの確認

docker image ls

image.png

・実行コンテナの確認

docker container ls

image.png

Web→API→DBサーバ間のデータ連携の確認

・Webブラウザにて、下記コマンドを実行

http://localhost:8081

image.png

・【API Test】ボタン押下
image.png

・【Database Test】ボタン押下
image.png

コンテナとイメージの削除(後片付け)

・コンテナの削除

docker compose down

image.png

・コンテナイメージの削除

docker image rm イメージID

image.png

最後に

今回のハンズオンの参考として、CloudTech内のレッスン動画を複数回見て勉強しました。とても素晴らしい教材なので皆さんも是非ご活用ください。
下記にリンクを貼っておきます。

1
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
1
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?