firebase デプロイ
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
* 目次 [#z20d0797]
#contents
* はじめに [#e8c10739]
ngrokで、デプロイできたが、firebaseを使ってデプロイする方...
* Firebase Hosting [#fbccba6d]
https://firebase.google.com/docs/hosting?hl=ja
* 初期化 [#l8d5e59c]
firebase init hosting
publicディレクトリができる。ダミーのindex.htmlができる
* 手順 [#f26fc1c8]
flutter build web
cd public
firebase deploy --only hosting
** firebase.jsonの修正 [#vab9a04b]
デフォルトだと、publicフォルダになっているので、flutterの...
*** 変更後のサンプル [#y7897c3f]
{
"hosting": {
"public": "build/web",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
** 環境変数を設定した状態でデプロイできるか検証 [#kdc9208a]
# build_with_env.sh
#!/bin/bash
# .env ファイルから環境変数を読み込む
export $(cat .env | xargs)
# flutter build web コマンドを実行する
flutter build web --dart-define=API_URL=$API_URL --dart-...
このスクリプトを使ってビルドする場合:
スクリプトファイル(例:build_with_env.sh)を作成します。
スクリプトファイルに実行権限を与えます。
chmod +x build_with_env.sh
スクリプトを実行してビルドします。
./build_with_env.sh
* 紹介記事 [#q6c9ea56]
** Hothingの機能を有効化する [#r31362da]
https://www.flutter-study.dev/host-web-app/hosting
** Firebase/HostingでWebアプリを外部公開しよう [#f8a311e9]
https://qiita.com/my_programming/items/5950b7e27161dc9ec838
** Firebase HostingでWebサイトをデプロイする [#r43a395f]
https://dev.classmethod.jp/articles/firebase-hosting-depl...
** HostingでWebアプリ公開 [#b33de1e6]
https://www.flutter-study.dev/host-web-app/host-web-app
* その他 [#q70058e8]
** 初心者がFlutterのDocker環境を作る [#caef04dd]
https://zenn.dev/citron633/articles/6cb3f390c6c98b
** Docker上にflutter開発環境を構築する(Linux) [#y16a455f]
** https://zenn.dev/ysuito/articles/69af1203be532d [#pd2c...
終了行:
* 目次 [#z20d0797]
#contents
* はじめに [#e8c10739]
ngrokで、デプロイできたが、firebaseを使ってデプロイする方...
* Firebase Hosting [#fbccba6d]
https://firebase.google.com/docs/hosting?hl=ja
* 初期化 [#l8d5e59c]
firebase init hosting
publicディレクトリができる。ダミーのindex.htmlができる
* 手順 [#f26fc1c8]
flutter build web
cd public
firebase deploy --only hosting
** firebase.jsonの修正 [#vab9a04b]
デフォルトだと、publicフォルダになっているので、flutterの...
*** 変更後のサンプル [#y7897c3f]
{
"hosting": {
"public": "build/web",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
** 環境変数を設定した状態でデプロイできるか検証 [#kdc9208a]
# build_with_env.sh
#!/bin/bash
# .env ファイルから環境変数を読み込む
export $(cat .env | xargs)
# flutter build web コマンドを実行する
flutter build web --dart-define=API_URL=$API_URL --dart-...
このスクリプトを使ってビルドする場合:
スクリプトファイル(例:build_with_env.sh)を作成します。
スクリプトファイルに実行権限を与えます。
chmod +x build_with_env.sh
スクリプトを実行してビルドします。
./build_with_env.sh
* 紹介記事 [#q6c9ea56]
** Hothingの機能を有効化する [#r31362da]
https://www.flutter-study.dev/host-web-app/hosting
** Firebase/HostingでWebアプリを外部公開しよう [#f8a311e9]
https://qiita.com/my_programming/items/5950b7e27161dc9ec838
** Firebase HostingでWebサイトをデプロイする [#r43a395f]
https://dev.classmethod.jp/articles/firebase-hosting-depl...
** HostingでWebアプリ公開 [#b33de1e6]
https://www.flutter-study.dev/host-web-app/host-web-app
* その他 [#q70058e8]
** 初心者がFlutterのDocker環境を作る [#caef04dd]
https://zenn.dev/citron633/articles/6cb3f390c6c98b
** Docker上にflutter開発環境を構築する(Linux) [#y16a455f]
** https://zenn.dev/ysuito/articles/69af1203be532d [#pd2c...
ページ名: