Skip to content

Instantly share code, notes, and snippets.

@jmdfm
Created January 27, 2024 00:28
Show Gist options
  • Save jmdfm/e4f5d5db1af5ffd19ef931373f399299 to your computer and use it in GitHub Desktop.
Save jmdfm/e4f5d5db1af5ffd19ef931373f399299 to your computer and use it in GitHub Desktop.
Standard dip.yml
# Required minimum dip version
version: "7.1.1"
environment:
COMPOSE_EXT: development
compose:
files:
- .docker/docker-compose.yml
project_name: vocsurveys
interaction:
shell:
description: Open the Bash shell in app's container
service: app
command: /bin/bash
compose:
run_options: [no-deps]
bundle:
description: Run Bundler commands
service: app
command: bundle
yarn:
description: Run Yarn commands
service: app
command: yarn
rake:
description: Run Rake commands
service: app
command: bundle exec rake
rspec:
description: Run Rails unit tests
service: rails
command: bundle exec rspec --exclude-pattern spec/system/**/*_spec.rb
subcommands:
system:
description: Run Rails system tests
service: rspec_system
command: bundle exec rspec --pattern spec/system/**/*_spec.rb
compose:
run_options: [service-ports, use-aliases]
guard:
description: Run Guard as test watcher
service: rspec_system
command: bundle exec guard
compose:
run_options: [service-ports, use-aliases]
rails:
description: Run Rails commands
service: app
command: bundle exec rails
environment:
VITE_HOST: host.docker.internal
subcommands:
s:
description: Run Rails server at http://localhost:3000
service: rails
compose:
run_options: [service-ports, use-aliases]
logs:
description: Display last 200 lines of Rails logs and follow
service: rails
compose:
method: logs
run_options: [follow, tail='200']
sidekiq:
description: Run sidekiq in background
service: worker
compose:
method: up
run_options: [detach]
clock:
description: Run the Clock service
service: clock
compose:
method: up
run_options: [detach]
psql:
description: Run Postgres psql console
service: app
default_args: owl_rails_development
environment:
PGPASSWORD: postgrespw
command: psql -h postgres -U postgres
clean_cache:
description: Delete cache files on the host machine
command: rm -rf ./tmp/cache
nuke:
description: Blow away all containers and volumes
command: dip down --volumes
ci:
description: Run the CI automated checks locally
service: rspec_system
command: bin/ci/all
subcommands:
linter:
description: Runs the linter
command: bin/ci/linter
compose:
run_options: [service-ports, use-aliases]
auditing:
description: Runs the auditers
command: bin/ci/auditing
compose:
run_options: [service-ports, use-aliases]
unit:
description: Runs the linter
command: bin/ci/unit_specs
compose:
run_options: [service-ports, use-aliases]
system:
description: Runs the linter
command: bin/ci/system_specs
compose:
run_options: [service-ports, use-aliases]
compose:
run_options: [service-ports, use-aliases]
provision:
# We need the `|| true` part because some docker-compose versions
# cannot down a non-existent container without an error,
# see https://github.com/docker/compose/issues/9426
- dip nginx down || true
- dip compose down --volumes || true
- dip clean_cache
- dip nuke
- dip compose up -d postgres redis
- dip compose up -d --build --force-recreate app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment