{"action":"created","issue":{"url":"https://api.github.com/repos/docker/compose/issues/3761","repository_url":"https://api.github.com/repos/docker/compose","labels_url":"https://api.github.com/repos/docker/compose/issues/3761/labels{/name}","comments_url":"https://api.github.com/repos/docker/compose/issues/3761/comments","events_url":"https://api.github.com/repos/docker/compose/issues/3761/events","html_url":"https://github.com/docker/compose/issues/3761","id":167303270,"number":3761,"title":"Allow compose to accept arbitrary command on 'up'","user":{"login":"velvetcat","id":4248361,"avatar_url":"https://avatars.githubusercontent.com/u/4248361?v=3","gravatar_id":"","url":"https://api.github.com/users/velvetcat","html_url":"https://github.com/velvetcat","followers_url":"https://api.github.com/users/velvetcat/followers","following_url":"https://api.github.com/users/velvetcat/following{/other_user}","gists_url":"https://api.github.com/users/velvetcat/gists{/gist_id}","starred_url":"https://api.github.com/users/velvetcat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/velvetcat/subscriptions","organizations_url":"https://api.github.com/users/velvetcat/orgs","repos_url":"https://api.github.com/users/velvetcat/repos","events_url":"https://api.github.com/users/velvetcat/events{/privacy}","received_events_url":"https://api.github.com/users/velvetcat/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-07-25T07:47:34Z","updated_at":"2016-07-25T16:45:29Z","closed_at":null,"body":"and override the appropriate service/command clause in the docker-compose.yml\r\n\r\nUsage: \r\n`up [options] [SERVICE [COMMAND [ARGS...]]]`\r\n\r\nThis will allow reusing services in a more flexible way. "},"comment":{"url":"https://api.github.com/repos/docker/compose/issues/comments/235010878","html_url":"https://github.com/docker/compose/issues/3761#issuecomment-235010878","issue_url":"https://api.github.com/repos/docker/compose/issues/3761","id":235010878,"user":{"login":"aanand","id":1062,"avatar_url":"https://avatars.githubusercontent.com/u/1062?v=3","gravatar_id":"","url":"https://api.github.com/users/aanand","html_url":"https://github.com/aanand","followers_url":"https://api.github.com/users/aanand/followers","following_url":"https://api.github.com/users/aanand/following{/other_user}","gists_url":"https://api.github.com/users/aanand/gists{/gist_id}","starred_url":"https://api.github.com/users/aanand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aanand/subscriptions","organizations_url":"https://api.github.com/users/aanand/orgs","repos_url":"https://api.github.com/users/aanand/repos","events_url":"https://api.github.com/users/aanand/events{/privacy}","received_events_url":"https://api.github.com/users/aanand/received_events","type":"User","site_admin":false},"created_at":"2016-07-25T16:45:28Z","updated_at":"2016-07-25T16:45:28Z","body":"This sounds like exactly what `run` is for. All that's meant by \"one-off\" is that `run` is not designed for long-running, always-up containers. Try this:\r\n\r\n```yaml\r\nversion: '2'\r\n\r\nservices:\r\n  node:\r\n    build:\r\n      context: .\r\n      dockerfile: dockerfile-node\r\n    ports:\r\n      - 3000:3000\r\n    volumes_from:\r\n      - sources\r\n    working_dir: /src\r\n    command: npm start\r\n\r\n  sources:\r\n    build:\r\n      context: .\r\n      dockerfile: dockerfile-sources\r\n```\r\n\r\nTo run the production command:\r\n\r\n    $ docker-compose up\r\n\r\nTo run the test command:\r\n\r\n    $ docker-compose run node npm test\r\n\r\nYou can always shove that last command into a Makefile if you don't want to repeat it all the time.\r\n\r\nAlternatively, you can additionally define a test override file, say **docker-compose.test.yml**:\r\n\r\n```yaml\r\nversion: \"2\"\r\n\r\nservices:\r\n  node:\r\n    command: npm test\r\n```\r\n\r\nAnd then run:\r\n\r\n    $ docker-compose -f docker-compose.yml -f docker-compose.test.yml up\r\n\r\nBut that's significantly more typing for a pretty simple use case."}}
{"actor":{"display_login":"aanand"}}