-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
115 lines (109 loc) · 2.67 KB
/
docker-compose.yml
File metadata and controls
115 lines (109 loc) · 2.67 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
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
x-shared-env: &shared-env
RAILS_DB_HOST: postgres
GEM_PATH: /usr/local/bundle:/opt/bundle
services:
rails:
container_name: skills_rails
tty: true
stdin_open: true
env_file: .env
image: skills-dev/rails
environment:
<<: *shared-env
RAILS_ENV: development
BUNDLE_PATH: /usr/local/bundle
build:
context: ./config/docker
dockerfile: Rails.dockerfile
ports:
- "3000:3000"
volumes:
- .:/myapp
- ./config/docker/development/home/rails:/home/developer
- gem_cache:/usr/local/bundle
init: true
healthcheck:
test: ["CMD-SHELL", "curl -f http://127.0.0.1:3000/status/health || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 90s
depends_on:
postgres:
condition: service_healthy
test:
container_name: skills_test
tty: true
stdin_open: true
env_file: .env
image: skills-test/rails
environment:
<<: *shared-env
RAILS_ENV: test
BUNDLE_PATH: /usr/local/bundle
build:
context: ./config/docker
dockerfile: Rails.dockerfile
ports:
- "3001:3000"
volumes:
- .:/myapp
- ./config/docker/test/home/rails:/home/test
- gem_cache:/usr/local/bundle
profiles:
- test
- all
depends_on:
postgres:
condition: service_healthy
postgres:
container_name: skills_postgres
image: postgres:16
ports:
- "5432:5432"
env_file: .env
volumes:
- postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER:-postgres} -d $${POSTGRES_DB:-postgres}"]
interval: 5s
timeout: 5s
retries: 5
assets:
container_name: skills_assets
image: ruby:4.0.1
working_dir: /myapp
environment:
BUNDLE_PATH: /usr/local/bundle
command: >
/bin/bash -c "
curl -fsSL https://deb.nodesource.com/setup_24.x | bash - && apt-get install -y nodejs &&
npm install -g corepack && corepack enable && bin/assets &&
sleep infinity"
volumes:
- .:/myapp
- gem_cache:/usr/local/bundle
depends_on:
rails:
condition: service_healthy
worker:
container_name: skills_worker
image: ruby:4.0.1
environment:
<<: *shared-env
RAILS_ENV: development
BUNDLE_PATH: /usr/local/bundle
env_file: .env
working_dir: /myapp
command: /bin/bash -c "bundle install && bundle exec rails jobs:work"
volumes:
- .:/myapp
- gem_cache:/usr/local/bundle
depends_on:
postgres:
condition: service_healthy
rails:
condition: service_healthy
volumes:
gem_cache:
postgres: