-
Notifications
You must be signed in to change notification settings - Fork 12
/
compose.yml
133 lines (123 loc) · 2.88 KB
/
compose.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
x-app: &app
build:
dockerfile: ./dev.Dockerfile
context: .
args:
RUBY_VERSION: '3.3.6'
PG_MAJOR: '14'
image: tramline-site-dev:1.0.0
environment: &env
RAILS_ENV: ${RAILS_ENV:-development}
tmpfs:
- /tmp
- /app/tmp/pids
x-backend: &backend
<<: *app
stdin_open: true
tty: true
volumes:
- .:/rails:cached
- bundle:/usr/local/bundle
- rails_cache:/app/tmp/cache
environment:
<<: *env
REDIS_URL: redis://redis:6379/
DATABASE_URL: postgres://postgres:postgres@postgres:5432
BOOTSNAP_CACHE_DIR: /usr/local/bundle/_bootsnap
XDG_DATA_HOME: /app/tmp/caches
EDITOR: vim
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
setup:
condition: service_completed_successfully
ngrok:
condition: service_healthy
services:
pre-setup:
<<: *app
volumes:
- .:/rails:cached
- bundle:/usr/local/bundle
- rails_cache:/app/tmp/cache
command: [ "/bin/bash", "/rails/bin/setup.creds", "-e", "dev" ]
stdin_open: true
tty: true
profiles:
- pre-setup
setup:
<<: *backend
command: [ "/bin/bash", "/rails/bin/setup.docker.dev" ]
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
ngrok:
condition: service_healthy
ngrok:
image: ngrok/ngrok:latest
command: [ "http", "https://web:3000", "--log=stdout", "--host-header=rewrite" ]
env_file: .env.development
ports:
- '4040:4040'
healthcheck:
test: /bin/bash -c "</dev/tcp/ngrok/4040"
interval: 60s
timeout: 1s
retries: 2
start_period: 3s
web:
<<: *backend
command: bundle exec rails server -p 3000 -b 'ssl://0.0.0.0:3000?key=config/certs/localhost-key.pem&cert=config/certs/localhost.pem'
ports:
- '3000:3000'
healthcheck:
test: [ "CMD", "curl", "-k", "-f", "-H", "X-Monitor-Allowed: 1", "https://localhost:3000/up" ]
interval: 60s
timeout: 1s
retries: 2
start_period: 3s
css:
<<: *backend
command: bundle exec rails tailwindcss:watch
depends_on:
web:
condition: service_healthy
sidekiq:
<<: *backend
command: bundle exec sidekiq -C config/sidekiq.yml
postgres:
image: postgres:14
volumes:
- .psqlrc:/root/.psqlrc:ro
- postgres:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: postgres
ports:
- '5442:5432'
healthcheck:
test: pg_isready -U postgres -h 127.0.0.1
interval: 60s
timeout: 1s
retries: 2
start_period: 3s
redis:
image: redis:6.2-alpine
volumes:
- redis:/data
ports:
- '6389:6379'
healthcheck:
test: redis-cli ping
interval: 60s
timeout: 1s
retries: 2
start_period: 3s
volumes:
bundle:
rails_cache:
postgres:
redis: