github.com/dnephin/dobi@v0.15.0/examples/init-db-with-rails/dobi.yaml (about)

     1  #
     2  # dobi.yaml example - Initialize a database
     3  # See README.md for a full description of this example.
     4  #
     5  
     6  meta:
     7      project: examplerailsdb
     8  
     9  
    10  mount=dbsource:
    11      bind: ./db
    12      path: /db
    13  
    14  
    15  image=rails:
    16      image: example/web
    17      dockerfile: Dockerfile
    18      context: ./app
    19      tags: ['{unique}', '{project}']
    20  
    21  image=database-img:
    22      image: example/database
    23      dockerfile: Dockerfile
    24      context: db/
    25      depends: [export-models]
    26      tags: ['{unique}', '{project}']
    27  
    28  
    29  compose=empty-db-env:
    30      files: [dockerfiles/empty-db.yaml]
    31      project: '{project}export'
    32      stop-grace: 2
    33  
    34  compose=dev-environment:
    35      files: [dockerfiles/docker-compose.yml]
    36      project: '{project}'
    37      depends: ['rails:tag', 'database-img:tag']
    38  
    39  
    40  job=export-models:
    41      use: rails
    42      mounts: [dbsource]
    43      artifact: db/export.sql
    44      command: /db/export.sh
    45      # Connect the container to the `empty-db-env` network created by Compose
    46      net-mode: '{project}export_default'
    47      # Cleanup any old environment before starting a new one
    48      depends: ['empty-db-env']
    49      annotations:
    50          description: "Export models to export.sql"
    51  
    52  
    53  alias=dev:
    54      tasks: ['dev-environment:down', 'dev-environment:attach']
    55      annotations:
    56          description: "Start a development environment"