-
Notifications
You must be signed in to change notification settings - Fork 51
/
dip.yml
87 lines (77 loc) · 2.59 KB
/
dip.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
version: '7.1'
environment:
RAILS_ENV: development
compose:
files:
- .dockerdev/compose.yml
project_name: anycable_rails_demo
interaction:
runner:
description: Open a Bash shell within a Rails container (with dependencies up)
service: rails
command: /bin/bash
bash:
description: Run an arbitrary script within a container (or open a shell without deps)
service: rails
command: /bin/bash
compose_run_options: [ no-deps ]
bundle:
description: Run Bundler commands
service: rails
command: bundle
compose_run_options: [ no-deps ]
rspec:
description: Run Rspec commands
service: rails
environment:
RAILS_ENV: test
command: bundle exec rspec --exclude-pattern 'system/**/*_spec.rb'
subcommands:
system: &rails_test_system
description: Run all Rails system tests
service: rspec_system
command: bundle exec rspec --pattern 'system/**/*_spec.rb'
compose:
run_options: [ service-ports, use-aliases ]
# Run Chrome via:
# chrome --remote-debugging-port=3333 --no-sandbox --no-startup-window
#
# NOTE: The command above assumes that you have a `chrome` alias to run Chrome executable.
# For example, on MacOS you can add the following to you shell profile:
# alias chrome="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome"
system:local:
<<: *rails_test_system
description: Run system tests via the local Chrome
environment:
RAILS_ENV: test
CHROME_URL: http://host.docker.internal:3333
CABLE_URL: ws://localhost:8081/cable
APP_HOST: localhost:3001
compose:
run_options: [service-ports, use-aliases]
rails:
description: Run Rails commands
service: rails
command: bundle exec rails
subcommands:
s:
description: Run Rails server at http://localhost:3000
service: web
compose:
run_options: [service-ports, use-aliases]
yarn:
descriptinn: Run yarn commands
service: rails
command: yarn
psql:
description: Run Postgres psql console
service: postgres
default_args: anycasts_dev
command: psql -h postgres -U postgres
provision:
- '[[ "$RESET_DOCKER" == "true" ]] && echo "Re-creating the Docker env from scratch..." && dip compose down --volumes || echo "Re-provisioning the Docker env..."'
- dip compose up -d postgres redis
- dip bundle install
- dip rails db:prepare
- dip rails db:test:prepare
- echo "🚀 Ready to rock! Run 'dip rails s' to start a Rails web server w/ AnyCable"