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

【フォルダ構成】React と Spring Boot をローカルの Docker 環境で動かす

4
Last updated at Posted at 2026-05-10

my-app/ (GitHubリポジトリルート)
├── docker-compose.yml <-- これを作成
├── frontend/ (React)
│ ├── Dockerfile <-- これを作成
│ └── ...
└── backend/ (Spring Boot)
└── ...

docker-compose.ymlとDockerfileを作成後に、コンテナを起動する。
設定ができたら、ターミナルでリポジトリのルートディレクトリに移動し、以下のコマンドを実行します。

Bash
①docker compose up --build
これを実行すると、Dockerが自動的に「Node.jsが入った環境(コンテナ)」を作り、その中で npm install と npm run dev を実行してくれます。
(この時点でのエディタの見た目は、ローカル状態)
②通常のdocker立ち上げの手順をふむ
③バックエンドでRun javaする
http://localhost:5173にアクセスする

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