-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
112 lines (105 loc) · 2.27 KB
/
docker-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
x-common-env-vars: &common-env-vars
RAILS_MASTER_KEY: ${RAILS_MASTER_KEY}
REDIS_URL: redis://redis-db:6379
DATABASE_URL: postgres://root:${POSTGRES_PASSWORD:-password}@postgres-db/
MINIO_ENDPOINT: http://${MINIO_PUBLIC_IP:-127.0.0.1}:9000
services:
web:
build: .
ports:
- "80:80"
environment:
<<: *common-env-vars
depends_on:
- redis-db
- postgres-db
- minio
- sidekiq
volumes:
- storage:/rails/storage
networks:
- frontend
- backend
deploy:
restart_policy:
condition: on-failure
healthcheck:
test: [ "CMD-SHELL", "curl --fail http://localhost/up || exit 1" ]
interval: 30s
timeout: 10s
retries: 3
postgres-db:
image: postgres
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
volumes:
- postgres:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: pg_isready
interval: 2s
timeout: 5s
retries: 30
networks:
- backend
minio:
image: bitnami/minio
ports:
- '9000:9000'
- '9001:9001'
volumes:
- minio:/bitnami/minio/data
networks:
- frontend
environment:
- MINIO_ROOT_USER=minioadmin
- MINIO_ROOT_PASSWORD=minioadmin
- MINIO_DEFAULT_BUCKETS=application
healthcheck:
test: [ "CMD-SHELL", "curl --fail http://localhost:9000/minio/health/live || exit 1" ]
interval: 30s
timeout: 10s
retries: 3
redis-db:
image: redis
networks:
- backend
deploy:
restart_policy:
condition: on-failure
volumes:
- redis:/data
healthcheck:
test: [ "CMD-SHELL", "redis-cli ping | grep PONG" ]
interval: 1s
timeout: 3s
retries: 5
sidekiq:
build: .
command: bundle exec sidekiq
environment:
<<: *common-env-vars
depends_on:
- redis-db
- postgres-db
- minio
volumes:
- storage:/rails/storage
networks:
- backend
healthcheck:
test: [ "CMD-SHELL", "curl --fail http://localhost:7433 || exit 1" ]
interval: 30s
timeout: 10s
retries: 3
networks:
backend:
frontend:
volumes:
storage:
postgres:
redis:
minio:
driver: local