Compose: Add pre/post command option

Created on 3 Sep 2014  路  4Comments  路  Source: docker/compose

This is an idea to have options to run a command on fig up / fig stop so script have a chance to do some prep.
e.g.:

pre-command: cp /root/.ssh/id_rsa .
post-command: do some cleanup, send email notification, etc.

web:
  build: .
  command: python manage.py runserver 0.0.0.0:8000
  volumes:

What do you think?

Update:

The pre-command and post-command will be run on host machine, not container.

Most helpful comment

No, run something on host machine - is bead idea.
Someone can use configs from antonymous users.

-1

All 4 comments

See #74 and #429 for similar.

Why not just wrap the fig command in a bash script, or some other build tool? make, tox, rake, there are already many for every language

Yes, I did using makefile but I think It is nice if Fig can handle it out of box.

No, run something on host machine - is bead idea.
Someone can use configs from antonymous users.

-1

Thanks for the feature suggestion!
I think this is a duplicate of #1341

I think we're going to enable this with #1510 instead.

Was this page helpful?
0 / 5 - 0 ratings