5
3

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.

GCEにElixir環境構築

Last updated at Posted at 2024-02-27

Brightの対象

Webアプリ開発 Elixir > クラス1 > Elixir環境構築 > クラウド > GCEにElixir環境構

前提事項

・GCPのアカウントがある

ブラウザで操作

Compute Engineを選択
image.png

インスタンスを作成を選択
image.png

N2を選択
image.png

ブートディスクの変更を選択
image.png

OSをUbuntuを選択
image.png

SSHで接続
image.png

image.png

image.png

Elixirインストール

(自作スクリプトを使ってます)
http://github.com/t-yamanashi/install

$ git clone http://github.com/t-yamanashi/install
$ cd install/elixir_asdf_install
$ sh asdf.sh
$ source ~/.bashrc
$ sh elixir20.sh 

image.png

$ sh phxinstall.sh 

image.png

$ cd 
$ mix phx.new hoge --no-ecto

image.png

$ cd hoge
$ mix phx.server

image.png

image.png

ブラウザで確認は外部IP:4000でアクセスします
が表示できません

image.png

FWの対策

インスタンス名を選択
image.png

編集を選択
image.png

httpを許可(厳密にはhttp-serverタグを使いたい)
image.png

FWの画面で4000番をhttp-serverタグで設定
(スクショ取り忘れた為省略)
image.png

Elixirを修正

vi config/dev.ex

下記のようにhttpの部分を修正
(0.0.0.0に変更)
image.png

phx.serverを起動して確認

image.png

image.png

表示できました

5
3
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
5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?