-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
77 lines (63 loc) · 2.45 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
version: "3.9"
# extension fields (x-..) introduced with docker-compose syntax 3.4.
# Anything that does not start with x-.. will raise error.
#
# format is [x-name]: [&anchor_name] [value]
# Change as needed
# to deploy the service into a swarm mode, create a cluster and
# docker stack deploy --compose-file docker-compose.yml ubdc-airbnb
# App Config
x-airbnb-proxy: &X-AIRBNB-PROXY "http://${ZYTE_PROXY_KEY:?zyte-key not set}:@proxy.crawlera.com:8011/"
## CELERY Config
x-app-workers-per-instance: &X-WORKERS-PER-INSTANCE 1
x-celery-worker-prefetch-multiplier: &X-CELERY-WORKER-PREFETCH-MULTIPLIER 2
x-celery-task-default-rate-limit: &X-CELERY-DEFAULT-RATE-LIMIT '10/m'
# RABBITMQ Config
x-rabbitmq-host: &X-RABBITMQ_HOST "${RABBITMQ_HOST:-host.docker.internal}" # default: (points at the host machine)
x-rabbitmq_username: &X-RABBITMQ-USERNAME "${RABBITMQ_USERNAME:-rabbit}"
x-rabbitmq-password: &X-RABBITMQ-PASSWORD "${RABBITMQ_PASSWORD:-carrot}"
x-rabbitmq-port: &X-RABBITMQ-PORT 5672
x-rabbitmq-vhost: &X-RABBITMQ-VHOST "${RABBITMQ_VIRTUAL_HOST:-/}"
# Database conf
x-database-host: &X-DATABASE-HOST "host.docker.internal" # default: host.docker.internal (points at the host machine)
x-database-dbname: &X-DATABASE-DBNAME "postgres"
x-database-username: &X-DATABASE-USERNAME "postgres"
x-database-password: &X-DATABASE-PASSWORD "airbnb"
x-database-port: &X-DATABASE-PORT 5432
x-common-env: &common-env
AIRBNB_PROXY: *X-AIRBNB-PROXY
DJANGO_DEBUG: "False"
WORKERS_PER_INSTANCE: *X-WORKERS-PER-INSTANCE
CELERY_WORKER_PREFETCH_MULTIPLIER: *X-CELERY-WORKER-PREFETCH-MULTIPLIER
CELERY_DEFAULT_RATE_LIMIT: *X-CELERY-DEFAULT-RATE-LIMIT
RABBITMQ_HOST: *X-RABBITMQ_HOST
RABBITMQ_PORT: *X-RABBITMQ-PORT
RABBITMQ_USERNAME: *X-RABBITMQ-USERNAME
RABBITMQ_PASSWORD: *X-RABBITMQ-PASSWORD
RABBITMQ_VIRTUAL_HOST: *X-RABBITMQ-VHOST
DATABASE_DBNAME: *X-DATABASE-DBNAME
DATABASE_HOST: *X-DATABASE-HOST
DATABASE_PASSWORD: *X-DATABASE-PASSWORD
DATABASE_PORT: *X-DATABASE-PORT
DATABASE_USERNAME: *X-DATABASE-USERNAME
x-build-app: &build
build:
context: .
dockerfile: ./docker/airbnb/Dockerfile
services:
beat:
deploy:
replicas: 0
image: ${UBDC_DOCKER_REGISTRY:-}ubdc/ubdc-airbnb-engine:1.0.1
<<: *build
environment:
<<: *common-env
MODE: "beat"
worker:
deploy:
replicas: 1
image: ${UBDC_DOCKER_REGISTRY:-}ubdc/ubdc-airbnb-engine:1.0.1
<<: *build
environment:
<<: *common-env
MODE: "worker"