Heroku Error reading Rocket templates

I have a rocket web app deployed to Heroku, but I'm getting an error stating the template dir is not Accessible. How do I fix it

It's hard to say, but it seems that you hard-coded the path to a directory in /tmp

I didn't


Or I'm doing something wrong

Silly question, but did you copy the public/ directory into the same folder as your app?

Im not sure I did, I only followed the deployment guide as specified here

Am I supposed to copy it, or should I say how can I copy the public dir, maybe via a post build script or something

I've been able to make this work. I dockerize the application

FROM rust:1 as builder
WORKDIR /app
COPY . .
RUN cargo install --path .

FROM debian:buster-slim as runner
WORKDIR /app
COPY --from=builder /usr/local/cargo/bin/rustly /app/rustly
COPY --from=builder /app/migrations /app/migrations
COPY --from=builder /app/public /app/public
COPY --from=builder /app/templates /app/templates
COPY --from=builder /app/*.toml /app/
ENV ROCKET_ADDRESS=0.0.0.0

EXPOSE 8000
CMD ["/app/rustly"]
1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.