The solution was little bit different for me. First of all I needed to give a reference of the entrypointfile to the docker-compose.My dockerfile, docker-compose and entrypoint file stays all in a directory called docker, so
services:
app:
build:
context: ..
dockerfile: docker/Dockerfile.development
entrypoint: docker/development-entrypoint.sh
ports:
- 3000:3000
env_file:
- ../.env.development
depends_on:
- postgres
I need to also change the execute right of the entrypoint and I did this in the dockerfile like this.
RUN chmod 755 docker/entrypoint.sh
The most annoying part was the .sh file. Normally by many different linux systems, you would start the .sh file as this
#!/bin/bash
Basicly, in one linux system, you use different shells.In .sh files, in order to define which shell you want to use, you start the file as show. But for me it did not work, since I was using node alpine image, and when I checked, there was no bash at all, so I had to chagne it to this.
#!/bin/sh
Hope it helps you or anyone who is having problem with this!