Phoenix 1.2를 설정하여 두 가지 Heroku 환경을 갖출려고합니다. dev/testing (this-app-12345.herokuapp.com URL을 유지), 및 표준 프로덕션 환경을 제공합니다.Phoenix 용 Heroku에서 dev 환경 빌드하기
Creating app... done, ⬢ first-instance-12345
https://first-instance-12345.herokuapp.com/ | https://git.heroku.com/first-instance-12345.git
내가 다음 config/
파일을 변경 buildpacks를 추가하고 git push heroku master
을 실행 :
mix phoenix.new my_app
cd my_app
mix ecto.create
mix ecto.migrate
git init && git add . && git commit -m "Initial commit"
heroku create
이 나에게 Heroku가 인스턴스를 제공합니다
현재, 나는 일반적인 방법을 내 응용 프로그램 설정 모든 것이 작동합니다.
이제 다른 Heroku 인스턴스를 만들고 싶습니다. 배포 할 수도 있습니다. 나는 새로운 인스턴스 prod.exs의 URL을 교체 할 경우 ...
Creating app... done, ⬢ second-instance-23456
https://second-instance-23456.herokuapp.com/ | https://git.heroku.com/second-instance-23456.git
config :my_app, MyApp.Endpoint,
http: [port: {:system, "PORT"}],
url: [scheme: "https", host: "second-instance-23456.herokuapp.com", port: 443], force_ssl: [rewrite_on: [:x_forwarded_proto]],
을 ... 그리고 그것을 커밋 git push heroku master
을 실행 : 다시 heroku create
를 실행하면, 내가 얻을 12345.herokuapp.com의 첫 번째 인스턴스에 계속 배포됩니다. 이는 내가 원하는 것이 아닙니다.
빌드 팩을 다시 실행해도 도움이되지 않습니다.
$ heroku buildpacks:add https://github.com/HashNuke/heroku-buildpack-elixir
▸ The buildpack https://github.com/HashNuke/heroku-buildpack-elixir is already set on your app.
$ heroku buildpacks:add https://github.com/gjaldon/phoenix-static-buildpack
▸ The buildpack https://github.com/gjaldon/phoenix-static-buildpack is already set on your app.
피닉스를 여러 영웅 환경에 배포하는 표준 방법 (또는 방법)이 있습니까? (그리고 희망적으로 배포 할 애플리케이션을 지정하십시오.)
을 원격 : npm ERR! addLocal/tmp/build_281dbc927c24aa3bb5ad67f310924ca2/deps/phoenix를 설치할 수 없습니다. remote : npm ERR! enoent 이것은 npm 자체에서 문제가되지 않을 가능성이 높습니다. remote : npm ERR! enoent이고 npm과 관련된 파일을 찾을 수 없습니다. " ... 중간 단계가 있습니까? –
'remote : - package.json'에 노드 버전이 지정되지 않았습니다 .' .... "engines": { "npm": "7.6.0"}'을 추가했지만 아무 소용이 없습니다. –
새로운 (두 번째) 리모컨에서만 발생합니까? 두 번째 앱에 모든 buildpack을 추가해보십시오 :'heroku buildpacks : add --app second-instance-23456 https : //github.com/...'(마치'--app '인수)를 누른 다음 다시 누르십시오. – Dogbert