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.