Docker Swarm and Postgraphile: How to add DATABASE_URL_FILE environment variable?

I am actually new to programming and Docker. I tried to rebuild the graphile/postgraphile:4.7.0 image to add DATABASE_URL_FILE environment variable support. This is what I do and the output.

Dockerfile

FROM node:alpine
LABEL description="Instant high-performance GraphQL API for your PostgreSQL database https://github.com/graphile/postgraphile"

# Install PostGraphile and PostGraphile connection filter plugin
RUN npm install -g postgraphile
RUN npm install -g postgraphile-plugin-connection-filter

EXPOSE 5000

# patch postgraphile:4.7.1; DATABASE_URL_FILE environment variable implementation.
COPY docker-entrypoint.sh /postgraphile/
WORKDIR /postgraphile/
ENTRYPOINT ["./docker-entrypoint.sh", "postgraphile", "-n", "0.0.0.0"]

docker-entrypoint.sh copied from postgres docker-entrypoint.sh

# usage: file_env VAR [DEFAULT]
#    ie: file_env 'XYZ_DB_PASSWORD' 'example'
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
#  "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature)
file_env() {
    local var="$1"
    local fileVar="${var}_FILE"
    local def="${2:-}"
    if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
        echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
        exit 1
    fi
    local val="$def"
    if [ "${!var:-}" ]; then
        val="${!var}"
    elif [ "${!fileVar:-}" ]; then
        val="$(< "${!fileVar}")"
    fi
    export "$var"="$val"
    unset "$fileVar"
}

# Loads various settings that are used elsewhere in the script
# This should be called before any other functions
docker_setup_env() {
    file_env 'DATABASE_URL'
}

output

$ docker-compose up postgraphile
Attaching to test_postgraphile_1
postgraphile_1  | standard_init_linux.go:211: exec user process caused "exec format error"
test_postgraphile_1 exited with code 1

Sincerely,
kidfromtheast

Source: StackOverflow