Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mizukiokushima/docker_1st
https://github.com/mizukiokushima/docker_1st
Last synced: 24 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/mizukiokushima/docker_1st
- Owner: MizukiOkushima
- Created: 2024-08-11T09:02:25.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-11T09:23:14.000Z (5 months ago)
- Last Synced: 2024-08-11T10:28:27.751Z (5 months ago)
- Language: PHP
- Size: 68.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Docker_1st
Dockerを試す。
今回はDockerでLaravel環境を一発で作ってくれるLaravel sailを使用。
環境構築を含め試す。### DockerContainer
ockerContainer 料理
PCの中で動く仮想環境の空間
この中にPHP, Laravel, Node.js等入れてアプリケーションを動かすようにできる環境を作成する。
DockerRepository→DockerImage→DockerContainerの流れで生成する。### DockerImage
DockerImage レシピ### DockerRepository
DockerHub, GCR, ECR等のWEBプラットフォーム### DockerFile
上記内容をまとめたファイル(具体的に記載されている内容は以下の通り)
```
# ベースイメージを指定
FROM python:3.8# 作業ディレクトリを指定
WORKDIR /usr/src/app# 現ディレクトリ(./)から作業ディレクトリ(/usr/src/app)にファイルをコピー
COPY ..# 依存関係(pipモジュール)をインストール
RUN pip install --no-cache-dir -r requirements.txt# コンテナ内でコマンド`python./app.py`を実行
CMD ["python","./app.py"]
```### DockerCompose
コンテナは複数作られることが多い
例として...
ContainerA アプリケーション(フロントエンド) Node.js npm React
ContainerB アプリケーション(サーバーサイド) PHP Laravel
ContainerC ミドルフェア MySQL
独立しているが連携してデータのやり取りが可能
docker-compose.ymlが必要### DockerVolumes
データを入れて保存しておける領域
DockerContainerやImageと別で存在しているエリア
テストデータやダミーデータをVolumesに入れておけばContainer間でで共有可能になる
DockerではメモリやCPUをどれだけ使用するか指定する### Laravel Sail
DockerでLaravel環境を一発で作ってくれるコマンドラインツールLaravel Sail - Laravel 11.x
https://laravel.com/docs/11.x/sail
Laravel Sail - Installation
https://laravel.com/docs/11.x/installation以下のコマンドでインストールする(Dockerを起動しておくこと)
```
curl -s "https://laravel.build/Docker_1st" | bash
```
インストール後以下のコマンドを実行
```
cd Docker_1st && ./vendor/bin/sail up
```
.envファイルに以下のポートを記載する
```
APP_PORT=8080 # ポート80番が使われているため指定する
FORWARD_DB_PORT=33066 # ポート3306番が使われているため指定する
```
参考サイト
https://lotus-base.com/blog/35/
## About Laravel
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
- [Simple, fast routing engine](https://laravel.com/docs/routing).
- [Powerful dependency injection container](https://laravel.com/docs/container).
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
- [Robust background job processing](https://laravel.com/docs/queues).
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).Laravel is accessible, powerful, and provides tools required for large, robust applications.
## Learning Laravel
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch.
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
## Laravel Sponsors
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com).
### Premium Partners
- **[Vehikl](https://vehikl.com/)**
- **[Tighten Co.](https://tighten.co)**
- **[WebReinvent](https://webreinvent.com/)**
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
- **[64 Robots](https://64robots.com)**
- **[Curotec](https://www.curotec.com/services/technologies/laravel/)**
- **[Cyber-Duck](https://cyber-duck.co.uk)**
- **[DevSquad](https://devsquad.com/hire-laravel-developers)**
- **[Jump24](https://jump24.co.uk)**
- **[Redberry](https://redberry.international/laravel/)**
- **[Active Logic](https://activelogic.com)**
- **[byte5](https://byte5.de)**
- **[OP.GG](https://op.gg)**## Contributing
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
## Code of Conduct
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
## Security Vulnerabilities
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [[email protected]](mailto:[email protected]). All security vulnerabilities will be promptly addressed.
## License
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
# Docker_1st