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.

ローカル環境構築

Last updated at Posted at 2023-10-12

dockerでローカル環境を構築したため備忘録

1.docker-compose.ymlでローカル環境を構築する

※すでにdocker-compose.ymlが作成されている場合

docker-compose.ymlファイルがあるディレクトリに移動する
例)desktop/myfail/docker-compose.ymlの場合

$ cd desktop/myfail

ローカルの開発環境を起動させる

$ docker compose up -d

これで複数のコンテナが作成され起動する。Docker Desktopでコンテナが存在していればOK

2.コンテナ内に入る

$ docker exec -it コンテナ名 bash(/bin/bash)

3.conposerインストール

vendorディレクトリに必要なPHPライブラリや依存関係をインストールする
まずプロジェクト直下に移動する

$ cd /ver/www/laravel/ディレクトリ名

そしてcomposerをインストールする

$ composer install

Composerはプロジェクトのvendorディレクトリに必要なPHPライブラリや依存関係をインストールします
プロジェクトの開発環境を設定し、依存関係をインストールできます

venderについて↓
https://biz.addisteria.com/laravel_vendor/

補足

DockerFileやdocker-compose.ymlを修正し再度コンテナを立ち上げたい場合は下記コマンドを実行

docker compose up --build
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?