-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdip.yml
More file actions
89 lines (80 loc) · 3.14 KB
/
Copy pathdip.yml
File metadata and controls
89 lines (80 loc) · 3.14 KB
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
88
89
version: "7.1"
compose:
files:
- .dockerdev/compose.yml
project_name: sway
interaction:
# This command spins up a Rails container with the required dependencies (such as databases),
# and opens a terminal within it.
runner:
description: Open a Bash shell within a Rails container (with dependencies up)
service: rails
command: /bin/bash
# Run a Rails container without any dependent services (useful for non-Rails scripts)
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]
# A shortcut to run Bundler commands
bundle:
description: Run Bundler commands
service: rails
command: bundle
compose_run_options: [no-deps]
# A shortcut to run npm commands
npm:
description: Run npm commands
service: rails
command: npm
compose_run_options: [no-deps]
# A shortcut to run RSpec (which overrides the RAILS_ENV)
rspec:
description: Run RSpec commands
service: rspec
rails:
description: Run Rails commands
service: rails
command: bundle exec rails
environment:
OTEL_EXPORTER: otlp
OTEL_SERVICE_NAME: sway-dip-rails
OTEL_EXPORTER_OTLP_ENDPOINT: http://0.0.0.0:4318
subcommands:
s:
description: Run Rails server at http://localhost:3000
service: web
compose:
run_options: [service-ports, use-aliases]
dev:
environment:
OTEL_EXPORTER: otlp
OTEL_SERVICE_NAME: sway-dip-dev
OTEL_EXPORTER_OTLP_ENDPOINT: http://0.0.0.0:4318
RAILS_ENV: development
NODE_ENV: development
PORT: "3000"
VITE_PORT: "3036"
VITE_RUBY_HOST: vite
SOLID_QUEUE_IN_PUMA: true
description: startup all processes (rails, vite) for development
command: |
dip up vite caddy --detach
dip compose attach web
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 compose down --volumes || true
- dip build
- dip bash -c "RAILS_ENV=development bin/setup"
- dip bash -c "RAILS_ENV=test bin/setup"
- |
/bin/bash -c '
if [[ ! -f ".dockerdev/caddy/certs/localhost-key.pem" || ! -f ".dockerdev/caddy/certs/localhost-key.pem" ]]; then
echo "\n================================================================================\n\n\n\n\n"
echo "Creating local TLS certs for running local production environment with Caddy. If this errors you may need to install and set up mkcert."
echo "\n\n\n\n\n================================================================================\n"
mkcert -key-file .dockerdev/caddy/certs/localhost-key.pem -cert-file .dockerdev/caddy/certs/localhost-cert.pem localhost
fi
'