How to run a file in a Docker on Heroku

Viewed 52

I have deployed my application on Heroku using an heroku.yml file a Dockerfile and while the build seem to have worked, the CMD instruction in my Dockerfile fails. Here is my Dockerfile:

FROM sitespeedio/node:ubuntu-20.04-nodejs-12.14.1
ENV NODE_ENV=production
COPY ["package.json", "package-lock.json*", "./"]
RUN npm install --production
COPY . .
CMD target/release/tokyo_server

target/release/tokyo_server is a .exe file built using Rust, and exists in the same folder as the Dockerfile. I need nodejs and dependencies installed because in the rust code I launch a nodejs instance.

Unfortunately, the last line of the Dockerfile fails and the apps crashes, as I get this message in the app's logs:

app[web.1]: /bin/sh: 1: target/release/tokyo_server: not found

I tried using ls in the Heroku console and I do in fact see the file I'm trying to execute (by simply running ls I can see the "target" folder), so I have no idea why the app cannot find it.

Help would be greatly appreciated, thanks for reading me!

0 Answers
Related