prooph / docker-files

Collection of prooph docker files
http://getprooph.org
249 stars 89 forks source link

add entrypoint and command to php cli #20

Closed basz closed 5 years ago

basz commented 6 years ago

We should add this ending for each php-cli version. Like we do for composer https://github.com/prooph/docker-files/blob/master/composer/7.1-cli#L22-L24

# Set up the application directory
VOLUME ["/app"]
WORKDIR /app

# Set up the command arguments
CMD ["-"]
ENTRYPOINT ["php"]

will allow to do docker-compose -f docker-compose.yml run php bin/some-script.php

instead of docker-compose -f docker-compose.yml run php php /app/bin/some-script.php

codeliner commented 6 years ago

PR?

sandrokeil commented 6 years ago

The main reason for the current implementation is, that you can simply run other CLI commands too. If we change this, you have to override the entrypoint. Not sure if this is necessary for development here. Maybe we should instead add an entrypoint definition to our Docker Compose file?

basz commented 6 years ago

I see. But do you do that? Run other commands then php with the php image?

Can always do -e “exec(‘ls’)” (sorry)

What your entry point definition does and how it can help I don’t know.

Edit: yes an entry point in the compose file would also achieve a similar behavior. You prefer that?

sandrokeil commented 6 years ago

Edit: yes an entry point in the compose file would also achieve a similar behavior. You prefer that?

Yes, because it's not a "BC break".

m9rco commented 5 years ago

lz