Skip to content

Exclude service on docker-compose up, docker-compose rm, etc #1294

Description

@olalonde

I have a service that I just need to run once (dc run createdbs):

createdbs:
  image: postgres:9.3
  links:
    - db
  command: >
    /bin/bash -c "
      psql --host=db --username=postgres -c 'CREATE DATABASE testnet;';
      psql --host=db --username=postgres -c 'CREATE DATABASE livenet;';
    "

Is it possible to not have it launched every time I run docker-compose up? I have looked at alternatives for creating the databases, but I'd rather not have separate file(s) just for this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions