2

I am trying to deploy a project on Heroku. I have set up bash entrypoint application, which is located in application root directory. Dockerfile content:

FROM node:10

# Create app directory
WORKDIR /usr/app

# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./

RUN npm install
# If you are building your code for production
# RUN npm ci --only=production

# Bundle app source
COPY . .

RUN entrypoint.sh

When heroku tries to deploy, it fails when calling entrypoint in this line:

RUN entrypoint.sh

It says that entrypoint.sh is not found - although it is located in project directory and it is added to container. See project structure here.

2 Answers2

2

You're using RUN instead of ENTRYPOINT.

  • RUN means "run this command as part of build".
  • ENTRYPOINT means "set this command as what happens when you do docker run."
Itamar Turner-Trauring
  • 3,430
  • 1
  • 13
  • 17
1

Use the ENTRYPOINT directive in docker file to set a script at entrypoint ENTRYPOINT ["./entrypoint.sh"] Also ensure it is executable (permissions)

Jordan Simba
  • 1,046
  • 7
  • 10