-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcompose.yml
130 lines (120 loc) · 4.6 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
x-common: &common
build:
context: .
dockerfile: docker/Dockerfile
target: python_dev_deps
platform: linux/amd64
environment:
- ADMIN_PASSWORD=123
- ALLOWED_HOSTS=localhost,127.0.0.1
- CACHE_URL=redis://redis:6379/1
- CELERY_BROKER_URL=redis://redis:6379/9
- CELERY_TASK_ALWAYS_EAGER=False
- CSRF_COOKIE_SECURE=False
- DATABASE_URL=postgres://hde:password@db:5432/hope_dedupe_engine
- DEFAULT_ROOT=/var/hope_dedupe_engine/default
- DJANGO_SETTINGS_MODULE=hope_dedup_engine.config.settings
- FILE_STORAGE_DEFAULT=django.core.files.storage.FileSystemStorage
- FILE_STORAGE_DNN=storages.backends.azure_storage.AzureStorage?azure_container=dnn&overwrite_files=True&connection_string=DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite:10000/devstoreaccount1;
- FILE_STORAGE_HOPE=storages.backends.azure_storage.AzureStorage?azure_container=hope&overwrite_files=True&connection_string=DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite:10000/devstoreaccount1;
- FILE_STORAGE_MEDIA=storages.backends.azure_storage.AzureStorage?azure_container=media&overwrite_files=True&connection_string=DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite:10000/devstoreaccount1;
- FILE_STORAGE_STATIC=storages.backends.azure_storage.AzureStorage?azure_container=static&overwrite_files=True&custom_domain=localhost:10000/&connection_string=DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite:10000/devstoreaccount1;
- MEDIA_ROOT=/var/hope_dedupe_engine/media
- PYTHONPATH=/code/src/:/code/__pypackages__/3.12/lib/
- SECRET_KEY=very-secret-key
- SECURE_SSL_REDIRECT=False
- SESSION_COOKIE_DOMAIN=
- SESSION_COOKIE_SECURE=False
- SOCIAL_AUTH_REDIRECT_IS_HTTPS=False
- STATIC_ROOT=/var/hope_dedupe_engine/static
volumes:
- .:/code
- /var/run/docker.sock:/var/run/docker.sock
restart: always
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
services:
backend:
<<: *common
ports:
- 8000:8000
# command: ["tail", "-f", "/dev/null"]
command: >
/bin/sh -c "
django-admin demo --skip-checks &&
django-admin upgrade &&
django-admin runserver 0.0.0.0:8000
"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/healthcheck"]
interval: 10s
timeout: 5s
retries: 5
db:
image: postgres:16
environment:
- POSTGRES_USER=hde
- POSTGRES_PASSWORD=password
- POSTGRES_DB=hope_dedupe_engine
volumes:
- postgres_data:/var/lib/postgresql/data/
ports:
- 5432:5432
restart: always
healthcheck:
test: ["CMD", "pg_isready", "-U", "hde", "-d", "hope_dedupe_engine"]
start_period: 5s
start_interval: 1s
interval: 5s
timeout: 4s
retries: 5
redis:
image: redis:7.2
ports:
- 6379:6379
restart: always
healthcheck:
test: ["CMD", "redis-cli", "ping"]
start_period: 5s
start_interval: 1s
interval: 5s
timeout: 4s
retries: 5
azurite:
image: mcr.microsoft.com/azure-storage/azurite
command: "azurite -l /workspace -d /workspace/debug.log --blobPort 10000 --blobHost 0.0.0.0 --loose --silent"
restart: always
ports:
- "10000:10000" # Blob service
volumes:
- azurite_data:/workspace
celery-worker:
<<: *common
# entrypoint: ["sh", "-c", "exec docker-entrypoint.sh \"$0\" \"$@\""]
# command: worker
command: >
sh -c '
mkdir -p /var/hope_dedupe_engine/default &&
chown -R user:app /var/hope_dedupe_engine &&
gosu user:app django-admin syncdnn &&
gosu user:app celery -A hope_dedup_engine.config.celery worker -E --loglevel=WARNING --concurrency=4
'
celery-beat:
<<: *common
entrypoint: ["sh", "-c", "exec docker-entrypoint.sh \"$0\" \"$@\""]
command: beat
celery-flower:
<<: *common
ports:
- 5555:5555
command: >
sh -c "
exec celery -A hope_dedup_engine.config.celery flower --address=0.0.0.0
"
volumes:
azurite_data:
postgres_data: