{"id":31358289,"url":"https://github.com/csam39/phoenix-liveview-docker-template","last_synced_at":"2026-04-29T22:37:55.312Z","repository":{"id":314140363,"uuid":"1053665219","full_name":"csam39/phoenix-liveview-docker-template","owner":"csam39","description":"A template for creating a Phoenix website with LiveView and Tailwind setup all in Docker.","archived":false,"fork":false,"pushed_at":"2025-09-10T17:46:36.000Z","size":96,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-10T21:46:50.264Z","etag":null,"topics":["devcontainers","docker","docker-compose","elixir","phoenix","phoenix-liveview","postresql","starter","tailwind","template"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/csam39.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-09-09T18:58:40.000Z","updated_at":"2025-09-10T17:46:40.000Z","dependencies_parsed_at":"2025-09-10T21:46:54.194Z","dependency_job_id":"eead1a65-e8d4-4b84-b57f-ef6877f47882","html_url":"https://github.com/csam39/phoenix-liveview-docker-template","commit_stats":null,"previous_names":["csam39/phoenix-liveview-docker-template"],"tags_count":null,"template":true,"template_full_name":null,"purl":"pkg:github/csam39/phoenix-liveview-docker-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csam39%2Fphoenix-liveview-docker-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csam39%2Fphoenix-liveview-docker-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csam39%2Fphoenix-liveview-docker-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csam39%2Fphoenix-liveview-docker-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csam39","download_url":"https://codeload.github.com/csam39/phoenix-liveview-docker-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csam39%2Fphoenix-liveview-docker-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277149964,"owners_count":25769492,"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","status":"online","status_checked_at":"2025-09-26T02:00:09.010Z","response_time":78,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["devcontainers","docker","docker-compose","elixir","phoenix","phoenix-liveview","postresql","starter","tailwind","template"],"created_at":"2025-09-26T21:50:10.310Z","updated_at":"2025-09-26T21:50:12.083Z","avatar_url":"https://github.com/csam39.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"App (Phoenix + LiveView + Tailwind)\n\nContainer-native dev environment using Docker Compose + Dev Containers (Cursor/VS Code).\nAll code, deps, and builds live on a Linux Docker volume—no macOS/APFS quirks.\n\nPrerequisites\n- Docker Desktop\n- Cursor (or VS Code) with the Dev Containers extension\n\nQuick start\n\ngit clone https://github.com/csam39/\u003crepo\u003e.git\ncd \u003crepo\u003e\ncp .env.dev.example .env.dev\n# Put a real secret in .env.dev (inside the dev container you can run: mix phx.gen.secret)\n\nOpen the folder in Cursor → Dev Containers: Reopen in Container.\n\nThen inside the Dev Container terminal:\n\n## Rename this template\n\nRun inside the Dev Container at `/app`:\n\nmix phx.gen.secret  # copy output into .env.dev as SECRET_KEY_BASE (See Environment section below for full file example)\n./scripts/rename_app.sh MyStore my_store (You can rename the generated app (default: :app / App) to anything with this script. This updates module names (App → MyStore), OTP app (:app → :my_store), folder names, and DB names (app_dev → my_store_dev).)\nrm -rf _build deps priv/static/assets\nmix deps.get \u0026\u0026 mix compile\nmix ecto.create\nmix phx.server\n\nVisit http://localhost:4000\n\nNot using Dev Containers?\n\ndocker compose up -d --build\ndocker compose exec web bash -lc 'mix ecto.create'\ndocker compose exec web bash -lc 'mix phx.server'\n\nEnvironment\n\n.env.dev (not committed) is read by the web service:\n\nPGUSER=postgres\nPGPASSWORD=postgres\nPGDATABASE=my_app_dev\nPGHOST=db\nPGPORT=5432\nSECRET_KEY_BASE=REPLACE_ME   # run `mix phx.gen.secret` to generate\nPHX_SERVER=true\nMIX_ENV=dev\n\n### Optional: Stable container/volume names\n\nBy default, Docker Compose uses the **folder name** as the project name (prefix for containers/volumes/networks).\nIf you want a fixed prefix (helpful for docs or multiple clones), set `COMPOSE_PROJECT_NAME`:\n\ncp .env.example .env\n# edit .env and set COMPOSE_PROJECT_NAME=my_app\n\nRecreate to apply the new name:\n\ndocker compose down\ndocker compose up -d --build\ndocker compose ps\n\nOne-off override (no .env file needed):\n\nCOMPOSE_PROJECT_NAME=my_app docker compose up -d\n\nChanging it later? Old volumes/networks will stick around under the old name. Clean them if you like:\n\ndocker compose down -v            # removes current project's containers/network/volumes\ndocker volume ls | grep my_app    # list stragglers\ndocker volume rm \u003cvol\u003e            # remove if desired\n\nWhat’s in this repo\n\n- Dockerfile.dev – dev image (Elixir + tools)\n- docker-compose.yml – web (Phoenix) + db (Postgres). Source is stored in code_data:/app\n- .devcontainer/devcontainer.json – opens /app in the web container and forwards ports\n- config/dev.exs – DB host db, esbuild/tailwind watchers, LiveView live_reload\n- config/config.exs\n    x tailwind → ../priv/static/assets/app.css\n    x esbuild → ../priv/static/assets/app.js\n\nEveryday commands (inside Dev Container)\n\n# start server\nmix phx.server\n\n# assets\nmix assets.setup    # installs tailwind/esbuild binaries\nmix assets.build    # builds CSS/JS once\n\n# DB\nmix ecto.create\nmix ecto.migrate\n\n# generators \u0026 tests\nmix phx.gen.live Accounts User users name:string\nmix test\n\nNotes on JS/CSS\n- This base uses Phoenix’s Tailwind/esbuild wrappers (no Node required).\n- The phoenix-colocated npm package is not used by default. If you want co-located hooks later:\n    1. install Node in the image + add a node_modules volume,\n    2. cd assets \u0026\u0026 npm init -y \u0026\u0026 npm i phoenix-colocated,\n    3. restore import \"phoenix-colocated/app\" in assets/js/app.js.\n\nTroubleshooting\n\n- Cookie error (secret_key_base): set SECRET_KEY_BASE in .env.dev, then recreate the web container:\n    docker compose up -d --force-recreate web\n- DB connect refused / tries localhost: ensure hostname: \"db\" in config/dev.exs.\n- Unstyled page / huge icons: run:\n    mix assets.setup \u0026\u0026 mix assets.build\nand confirm priv/static/assets/app.css exists.\n- Dev reload not reacting: watchers must be present in config/dev.exs. Restart \n    mix phx.server.\n\nUsing this as a template\n\n- Click Use this template on GitHub (or fork).\n- Update app/module names as needed, or regenerate fresh code in a new repo but keep the Docker + Dev Container files.\n\nProduction\nUse a multi-stage Dockerfile and mix assets.deploy + mix release. See Phoenix deployment guides.\n\nLicense\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsam39%2Fphoenix-liveview-docker-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsam39%2Fphoenix-liveview-docker-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsam39%2Fphoenix-liveview-docker-template/lists"}