-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdocker-compose.yml
132 lines (125 loc) · 4.39 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: carrot-mapper-dev
services:
db:
image: postgres:13
restart: always
ports:
- 5432:5432
environment:
- POSTGRES_PASSWORD=postgres
volumes:
- db_data:/var/lib/postgresql/data
frontend:
image: carrot-frontend
build:
context: app/next-client-app
dockerfile: Dockerfile
target: dev
command: npm run dev
ports:
- 3000:3000
environment:
- BACKEND_URL=http://api:8000
- BACKEND_ORIGIN=localhost:8000
- NEXTAUTH_URL=http://localhost:3000/
- NEXTAUTH_SECRET=verycomplexsecretkey
- NEXTAUTH_BACKEND_URL=http://api:8000/api/
- NODE_ENV=development
- WATCHPACK_POLLING=true
volumes:
- ./app/next-client-app:/app
- /app/node_modules
- /app/.next
depends_on:
- api
omop-lite:
image: ghcr.io/andyrae/omop-lite
volumes:
- ./vocabs:/vocabs
depends_on:
- db
environment:
- DB_PASSWORD=postgres
- DB_NAME=postgres
api:
image: carrot-backend
build:
context: app
dockerfile: api/Dockerfile
ports:
- 8000:8000
environment:
- FRONTEND_URL=http://frontend:3000
- ALLOWED_HOSTS=['localhost', '127.0.0.1','api', 'workers']
- DB_ENGINE=django.db.backends.postgresql
- DB_HOST=db
- DB_PORT=5432
- DB_NAME=postgres
- DB_USER=postgres
- DB_PASSWORD=postgres
- DEBUG=True
- WORKERS_UPLOAD_NAME=uploadreports-local
- SECRET_KEY=secret
- WORKERS_URL=http://workers:80
- WORKERS_RULES_NAME=RulesOrchestrator
- WORKERS_RULES_KEY=rules_key
- WORKERS_RULES_EXPORT_NAME=rules-exports-local
- STORAGE_CONN_STRING=DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite:10000/devstoreaccount1;QueueEndpoint=http://azurite:10001/devstoreaccount1;TableEndpoint=http://azurite:10002/devstoreaccount1;
- SIGNING_KEY=secret
volumes:
- ./app/api:/api
depends_on:
omop-lite:
condition: service_completed_successfully
workers:
image: carrot-workers
build:
context: app
dockerfile: workers/Dockerfile
ports:
- 8080:80
- 7071:80
environment:
# Set Docker to look for secrets locally
- AzureWebJobsSecretStorageType=files
- IsEncrypted=false
- AzureWebJobsStorage=DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite:10000/devstoreaccount1;QueueEndpoint=http://azurite:10001/devstoreaccount1;TableEndpoint=http://azurite:10002/devstoreaccount1;
- FUNCTIONS_WORKER_RUNTIME=python
- STORAGE_CONN_STRING=DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite:10000/devstoreaccount1;QueueEndpoint=http://azurite:10001/devstoreaccount1;TableEndpoint=http://azurite:10002/devstoreaccount1;
- APP_URL=http://api:8000/
# Three queues below need adding to Azure local storage
- WORKERS_UPLOAD_NAME=uploadreports-local
- RULES_QUEUE_NAME=rules-local
- RULES_FILE_QUEUE_NAME=rules-exports-local
# The address that can be used to reach the function app from outside
- WEBSITE_HOSTNAME=localhost:7071
# Database setup
- DB_ENGINE=django.db.backends.postgresql
- DB_HOST=db
- DB_PORT=5432
- DB_NAME=postgres
- DB_USER=postgres
- DB_PASSWORD=postgres
volumes:
- ./app/workers:/home/site/wwwroot
- ./app/shared:/shared
# Mount the local secret to Docker container
- ./app/workers/Secrets:/azure-functions-host/Secrets/
depends_on:
- api
- azurite
azurite:
image: mcr.microsoft.com/azure-storage/azurite
restart: always
volumes:
- ./app/azurite:/azurite
ports:
- 10000:10000
- 10001:10001
- 10002:10002
command: azurite --blobHost azurite --queueHost azurite --tableHost azurite --location /data --debug /data/debug.log --loose --skipApiVersionCheck
hostname: azurite
environment:
- AZURITE_ACCOUNTS=devstoreaccount1:Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==
volumes:
db_data: