Deno: Passing --allow-read flag when deploying

I’m trying to deploy a Deno app — you can see it here: GitHub - RoyalIcing/postage-stamp

I require reading a local font file, and so it hits this error when deploying:

error: Uncaught (in promise) PermissionDenied: Requires read access to “./inter-font/Inter-Regular.ttf”, run again with the --allow-read flag

Is there a way to change the flags passed?

We need to replace our Deno builder, it’s a little stale. For now, it’s best to use a Dockerfile. Just add a Dockerfile to your directory like this:

FROM hayd/deno:alpine-1.8.2

USER deno
ADD . .
RUN deno cache server.ts

CMD ["run", "--allow-read", "server.ts"]

Then comment out these two lines in your fly.toml:

# [build]
#   builder = "flyio/builder"

You should be good to go. You can change the CMD line to do whatever you need.

FYI, Deno now has official Docker builds.

Adding this alternate build info to the docs (with this example) would have been super helpful.

Oh good call! The docs are open source if you’re feeling ambitious: GitHub - superfly/docs

I don’t have a moment to work on that right now. I would have liked to file an issue on the docs repo to help remind you (its where I went first), but that repo disallows issues. :frowning:

Oh this forum is a great place to report it. :slight_smile: Keeping up with github issues across projects is wizardry we haven’t learned yet.