Unable to use environment vars inside dockerfile during build time

Hello @r4881t,

Sadly, you cannot reach your cluster/database/services that run in your environment during the build phase of your application (unless public).

Our builder that execute the Dockerfile are not in the same network than your environment, so it has no access/reach to databases.

When doing RUN npm run migrate, this command will be executed during the build ;(

If you want to run this command, you need to execute it during the start of your container application. So must be put inside the CMD section.

As you already have moved it to npm start, you should be good :slight_smile:

2 Likes