-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdocker-compose.yml
86 lines (70 loc) · 2.08 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
x-hub20-web-services: &backend_web_service
depends_on:
- db
- redis
x-hub20-background-services: &backend_celery_service
depends_on:
- db
- redis
- rabbitmq
x-hub20: &backend_service
image: "hub20:${TAG-latest}"
build:
context: .
restart: on-failure
services:
db:
image: "postgres:${HUB20_POSTGRES_SERVER_VERSION:-latest}"
healthcheck:
test: ["CMD", "pg_isready", "-U", "${HUB20_DATABASE_NAME:-hub20}"]
interval: 5s
retries: 5
# Make sure to match the HUB20_DATABASE_* variables
environment:
POSTGRES_DB: "${HUB20_DATABASE_NAME:-hub20}"
POSTGRES_USER: "${HUB20_DATABASE_USER:-hub20}"
POSTGRES_PASSWORD: "${HUB20_DATABASE_PASSWORD:-hub20_pass}"
# Redis for cache, session engine, channels transport
redis:
image: redis:latest
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 30s
retries: 50
# RabbitMQ for executing message queue/task management
rabbitmq:
image: bitnami/rabbitmq:latest
# Make sure to match the HUB20_QUEUE_* variables
environment:
RABBITMQ_USERNAME: "${HUB20_BROKER_USER:-hub20}"
RABBITMQ_PASSWORD: "${HUB20_BROKER_PASSWORD:-hub20_pass}"
# services that run off the base image
# Admin backend
admin:
<<: *backend_service
<<: *backend_web_service
environment:
HUB20_URLCONF_MODULE: hub20.admin.urls
command: uvicorn hub20.api.asgi:application --port 80 --host 0.0.0.0
# Web API
web:
<<: *backend_service
<<: *backend_web_service
command: uvicorn hub20.api.asgi:application --port 80 --host 0.0.0.0
run_payment_providers:
<<: *backend_service
command: django-admin run_providers
run_payment_processors:
<<: *backend_service
command: django-admin run_payment_processors
# Celery app
celery:
<<: *backend_service
<<: *backend_celery_service
command: celery -A hub20.api worker -l info -E
# Celery beat (periodic tasks)
celery_beat:
<<: *backend_service
<<: *backend_celery_service
command: celery -A hub20.api beat -l info -S django