gjaldon/heroku-buildpack-phoenix-static

how do I disable assets?

Closed this issue · 8 comments

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

I have the same use case

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

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.

@jeremyjh even websockets?

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.

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