{"id":18033972,"url":"https://github.com/miolab/phoenix_dev_containers_no_ecto","last_synced_at":"2025-03-27T06:31:21.843Z","repository":{"id":42671450,"uuid":"253216760","full_name":"miolab/phoenix_dev_containers_no_ecto","owner":"miolab","description":"Phoenixのno-ecto版Docker開発用リポジトリ","archived":true,"fork":false,"pushed_at":"2023-03-05T19:09:02.000Z","size":840,"stargazers_count":0,"open_issues_count":18,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-10T07:15:35.595Z","etag":null,"topics":["cicd","circleci","docker","elixir","phoenix"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/miolab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-05T11:16:25.000Z","updated_at":"2024-08-27T20:47:24.000Z","dependencies_parsed_at":"2023-02-06T07:32:30.127Z","dependency_job_id":null,"html_url":"https://github.com/miolab/phoenix_dev_containers_no_ecto","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miolab%2Fphoenix_dev_containers_no_ecto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miolab%2Fphoenix_dev_containers_no_ecto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miolab%2Fphoenix_dev_containers_no_ecto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miolab%2Fphoenix_dev_containers_no_ecto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miolab","download_url":"https://codeload.github.com/miolab/phoenix_dev_containers_no_ecto/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245797519,"owners_count":20673875,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cicd","circleci","docker","elixir","phoenix"],"created_at":"2024-10-30T11:09:10.647Z","updated_at":"2025-03-27T06:31:21.409Z","avatar_url":"https://github.com/miolab.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Phoenix Dev experiment containers (No Ecto)\n\n[![miolab](https://circleci.com/gh/miolab/phoenix_dev_containers_no_ecto.svg?style=svg)](https://github.com/miolab/phoenix_dev_containers_no_ecto)\n\nElixir製Webフレームワーク __Phoenix__ の `--no-ecto`版 __Docker__ 開発環境を構築します\n\n## 実行環境・バージョン\n\n- macOS\n- Elixir 1.11.3 (compiled with Erlang/OTP 23)\n- Phoenix 1.5.7\n- Node 14.15.4\n\n## 確認URL\n\n- テスト環境 http://0.0.0.0:4000\n\n---\n\n## ビルド〜Phoenixプロジェクト作成\n\n```terminal\n$ docker-compose build\n```\n\n```terminal\n$ docker-compose run --rm app mix phx.new . --app my_app --no-ecto\n\nCreating phoenix_dev_containers_no_ecto_app_run ... done\nThe directory /usr/src/app already exists. Are you sure you want to continue? [Yn]\n* creating config/config.exs\n* creating config/dev.exs\n* creating config/prod.exs\n* creating config/prod.secret.exs\n* creating config/test.exs\n* creating lib/my_app/application.ex\n* creating lib/my_app.ex\n* creating lib/my_app_web/channels/user_socket.ex\n* creating lib/my_app_web/views/error_helpers.ex\n* creating lib/my_app_web/views/error_view.ex\n* creating lib/my_app_web/endpoint.ex\n* creating lib/my_app_web/router.ex\n* creating lib/my_app_web/telemetry.ex\n* creating lib/my_app_web.ex\n* creating mix.exs\n* creating README.md\n* creating .formatter.exs\n* creating .gitignore\n* creating test/support/channel_case.ex\n* creating test/support/conn_case.ex\n* creating test/test_helper.exs\n* creating test/my_app_web/views/error_view_test.exs\n* creating lib/my_app_web/controllers/page_controller.ex\n* creating lib/my_app_web/templates/layout/app.html.eex\n* creating lib/my_app_web/templates/page/index.html.eex\n* creating lib/my_app_web/views/layout_view.ex\n* creating lib/my_app_web/views/page_view.ex\n* creating test/my_app_web/controllers/page_controller_test.exs\n* creating test/my_app_web/views/layout_view_test.exs\n* creating test/my_app_web/views/page_view_test.exs\n* creating lib/my_app_web/gettext.ex\n* creating priv/gettext/en/LC_MESSAGES/errors.po\n* creating priv/gettext/errors.pot\n* creating assets/webpack.config.js\n* creating assets/.babelrc\n* creating assets/js/app.js\n* creating assets/css/app.scss\n* creating assets/js/socket.js\n* creating assets/package.json\n* creating assets/static/favicon.ico\n* creating assets/css/phoenix.css\n* creating assets/static/images/phoenix.png\n* creating assets/static/robots.txt\n\nFetch and install dependencies? [Yn]\n* running mix deps.get\n* running mix deps.compile\n* running cd assets \u0026\u0026 npm install \u0026\u0026 node node_modules/webpack/bin/webpack.js --mode development\n\nWe are almost there! The following steps are missing:\n\n    $ cd app\n\nStart your Phoenix app with:\n\n    $ mix phx.server\n\nYou can also run your app inside IEx (Interactive Elixir) as:\n\n    $ iex -S mix phx.server\n```\n\n```terminal\n$ docker-compose up -d\n```\n\n```terminal\n$ docker-compose ps\n\n                Name                              Command               State           Ports\n------------------------------------------------------------------------------------------------------\nphoenix_dev_containers_no_ecto_app_1   sh -c mix phx.server --no-halt   Up      0.0.0.0:4000-\u003e4000/tcp\n```\n\n### ブラウザ確認\n\n- [http://localhost:4000/](http://localhost:4000/)\n\n  \u003cimg alt=\"phx_init_page\" src=\"https://user-images.githubusercontent.com/33124627/100324924-3c566300-300b-11eb-9f84-e5ff80c11a07.png\" width=\"455px\"\u003e\n\n### フォーマッティングとテスト\n\n```terminal\n$ docker-compose exec app bash -c \"mix format\"\n```\n\n```terminal\n$ docker-compose exec app bash -c \"MIX_ENV=test mix test\"\n\n...\n\nFinished in 0.3 seconds\n3 tests, 0 failures\n\nRandomized with seed 213195\n```\n\n## 新規ページ追加\n\n新規ページ `/watchme` を追加します\n\n- ルーティング設定（アップデート）\n\n  `app/lib/my_app_web/router.ex`\n\n  ```elixir\n  scope \"/\", MyAppWeb do\n  pipe_through :browser\n\n  get \"/\", PageController, :index\n  get \"/watchme\", WatchmeController, :index    # --\u003e add\n  end\n  ```\n\n- コントローラー追加（新規作成）\n\n  `app/lib/my_app_web/controllers/watchme_controller.ex`\n\n  ```elixir\n  defmodule MyAppWeb.WatchmeController do\n    use MyAppWeb, :controller\n\n    def index(conn, _params) do\n      render(conn, \"index.html\")\n    end\n  end\n  ```\n\n- ビュー追加（新規作成）\n\n  `app/lib/my_app_web/views/watchme_view.ex`\n\n  ```elixir\n  defmodule MyAppWeb.WatchmeView do\n    use MyAppWeb, :view\n  end\n  ```\n\n- テンプレート追加（新規作成）\n\n  `app/lib/my_app_web/templates/watchme/index.html.eex`\n\n  ```html\n  \u003csection class=\"phx-hero\"\u003e\n    \u003ch1\u003eオレオレコンテナをぜひ見てくれ\u003c/h1\u003e\n  \u003c/section\u003e\n  \u003csection class=\"row\"\u003e\n    \u003cp\u003eメリークリスマス！ 2020！\u003cbr\u003e\n      プレゼンテッド・バイ im（あいえむ）\u003c/p\u003e\n  \u003c/section\u003e\n  ```\n\n- コンテナを再起動して、ルーティングを確認\n\n  ```\n  $ docker-compose restart app\n  ```\n\n  ```terminal\n  $ docker-compose exec app mix phx.routes\n\n            page_path  GET  /                                      MyAppWeb.  PageController :index\n         watchme_path  GET  /watchme                               MyAppWeb.  WatchmeController :index\n  live_dashboard_path  GET  /dashboard                             Phoenix.LiveView.Plug  :home\n  live_dashboard_path  GET  /dashboard/:page                       Phoenix.LiveView.Plug  :page\n  live_dashboard_path  GET  /dashboard/:node/:page                 Phoenix.LiveView.Plug  :page\n            websocket  WS   /live/websocket                        Phoenix.LiveView.  Socket\n             longpoll  GET  /live/longpoll                         Phoenix.LiveView.  Socket\n             longpoll  POST  /live/longpoll                         Phoenix.LiveView. Socket\n            websocket  WS   /socket/websocket                      MyAppWeb.UserSocket\n  ```\n\n### ブラウザ確認\n\n- [http://localhost:4000/watchme](http://localhost:4000/watchme)\n\n  \u003cimg src=\"https://user-images.githubusercontent.com/33124627/99958502-d2507a80-2dcc-11eb-8ba3-b89612fb1f60.png\" width=\"455px\"\u003e\n\n---\n\n## （補足） プロジェクト・コンテナ環境削除\n\n```terminal\n$ docker-compose down --rmi all --volumes --remove-orphans\n\n$ rm -rf app/my_app\n```\n\n---\n\n## 参考情報\n\n- Credo\n  - Docs https://hexdocs.pm/credo/overview.html\n  - GitHub https://github.com/rrrene/credo\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiolab%2Fphoenix_dev_containers_no_ecto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiolab%2Fphoenix_dev_containers_no_ecto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiolab%2Fphoenix_dev_containers_no_ecto/lists"}