gjaldon / heroku-buildpack-phoenix-static

A Heroku buildpack for building Phoenix's static assets
MIT License
229 stars 224 forks source link

how do I disable assets? #62

Closed NullVoxPopuli closed 5 years ago

NullVoxPopuli commented 7 years ago

I have a socket/channel only app, so I don't have any sockets. Currently, when I try to deploy, I get the following error:

remote: -----> Building dependencies
remote:        Installing and caching node modules
remote: /app/tmp/buildpacks/9c47a362692688524e86000de35251234726449a19851f29f82387b8d8b2da550db082b36e99243f82a708aff896040ed9c7dc1c8d5bc89a74e6c0d234c486ad/lib/build.sh: line 105: cd: /tmp/build_6556d2d319c05df4d700e85466a5c262/./assets: No such file or directory
remote:  !     Push rejected, failed to compile Phoenix app.

here is my phoenix_static_buildpack.config

# Clean out cache contents from previous deploys
clean_cache=false

# We can change the filename for the compile script with this option
compile="compile"

# Remove node and node_modules directory to keep slug size down if it is not needed.
remove_node=true

# We can set the path to phoenix app. E.g. apps/phoenix_app when in umbrella.
phoenix_relative_path=.

# We can change phoenix mix namespace tasks. E.g. phx for phoenix 1.3 support.
phoenix_ex=phoenix
ponty96 commented 7 years ago

I have the same use case

wojtekmach commented 7 years ago

if you're not using assets then consider not using this buildpack and instead manually put phoenix.js into priv/ or not even that depending on your use case

NullVoxPopuli commented 7 years ago

I got this working on my fork

On Wed, May 10, 2017, 6:02 PM Aregbede Ayomide notifications@github.com wrote:

I have the same use case

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gjaldon/heroku-buildpack-phoenix-static/issues/62#issuecomment-300625835, or mute the thread https://github.com/notifications/unsubscribe-auth/AAMJarr8_lsg6MDjt5aEKEhKks1uhwywks5r4jPogaJpZM4NS9zy .

jeremyjh commented 6 years ago

The purpose of this buildpack is to compile static assets. If you do not need that functionality, you do not need this buildpack. See also the FAQ in the README of this repo:

This buildpack is only necessary when you need to compile static assets during deploys. You will not need this buildpack if you are using Phoenix only as a REST API.
NullVoxPopuli commented 6 years ago

@jeremyjh even websockets?

jeremyjh commented 6 years ago

I'm assuming if you have a channels only app, that means your client javascript is served by a different webserver or CDN. That build process should bring in all your javascript dependencies. Otherwise, you actually are serving assets from your Phoenix project but if you do need to serve only phoenix.js then wojtechmach's suggestion makes the most sense.

NullVoxPopuli commented 6 years ago

Excellent! Thanks, I'll try removing this buirdpack :)

On Mon., 17 Sep. 2018, 8:29 am Jeremy Huffman, notifications@github.com wrote:

I'm assuming if you have a channels only app, that means your client javascript is served by a different webserver or CDN. That build process should bring in all your javascript dependencies. Otherwise, you actually are serving assets from your Phoenix project but if you do need to serve only phoenix.js then wojtechmach's suggestion makes the most sense.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gjaldon/heroku-buildpack-phoenix-static/issues/62#issuecomment-422016358, or mute the thread https://github.com/notifications/unsubscribe-auth/AAMJasqJrxD689UQwhhAcVm2ncGxQtswks5ub6PLgaJpZM4NS9zy .

gjaldon commented 5 years ago

That's right. If your Phoenix app doesn't serve any static assets, then this buildpack is not needed.