-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yml
126 lines (115 loc) · 3.65 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
version: '3.4'
services:
localstack:
image: localstack/localstack:3.0.2
ports:
- '4966:4566' # LocalStack Gateway
- '4910-4959:4510-4559' # external services port range
env_file:
- 'compose/aws.env'
environment:
DEBUG: ${DEBUG:-1}
LS_LOG: WARN # Localstack DEBUG Level
SERVICES: s3,sqs,sns,firehose
LOCALSTACK_HOST: 127.0.0.1
volumes:
- '${TMPDIR:-/tmp}/localstack:/var/lib/localstack'
- ./compose/start-localstack.sh:/etc/localstack/init/ready.d/start-localstack.sh
healthcheck:
test: ['CMD', 'curl', 'localhost:4566']
interval: 5s
start_period: 5s
retries: 3
networks:
- cdp-tenant
redis:
image: redis:7.2.3-alpine3.18
ports:
- '6979:6379'
restart: always
networks:
- cdp-tenant
mongodb:
# Initialise a Mongo cluster with a replicaset of 1 node.
# Based on https://medium.com/workleap/the-only-local-mongodb-replica-set-with-docker-compose-guide-youll-ever-need-2f0b74dd8384
# Since we are using transactions, we require a replicaset. Local dev with docker compose uses 1 node below, but our live
# environments have multiple nodes.
# The replicaset needs initialising, so the healthcheck can be hijacked to initialise this so that it can keep retrying
# until the operation is successful (might need to wait a while after container boot for this to work, hence the interval/retries)
# WARNING: do not turn on authentication, otherwise will need to deal with generating key pairs and sharing them between
# the replicaset nodes. For local development this is overkill, so just turn off auth and connect to Mongo without creds.
image: mongo:6.0.13
command: ["--replSet", "rs0", "--bind_ip_all", "--port", "29017"]
networks:
- cdp-tenant
ports:
- 29017:29017
extra_hosts:
- "host.docker.internal:host-gateway"
healthcheck:
test: echo "try { rs.status() } catch (err) { rs.initiate({_id:'rs0',members:[{_id:0,host:'host.docker.internal:29017'}]}) }" | mongosh --port 29017 --quiet
interval: 5s
timeout: 30s
start_period: 0s
start_interval: 1s
retries: 30
volumes:
- mongodb-data:/data
restart: always
################################################################################
grafana:
image: grafana/otel-lgtm
ports:
- '9000:3000'
- '9317:4317'
- '9318:4318'
restart: always
networks:
cdp-tenant:
aliases:
- grafana.localtest.me
aspire-dashboard:
image: mcr.microsoft.com/dotnet/nightly/aspire-dashboard:8.2
ports:
- '18888:18888'
- '18889:18889'
restart: always
environment:
DOTNET_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS: true
networks:
cdp-tenant:
aliases:
- aspire-dashboard.localtest.me
cdp-defra-id-stub:
build: https://github.com/DEFRA/cdp-defra-id-stub.git
ports:
- '9200:9200'
links:
- 'redis:redis'
depends_on:
localstack:
condition: service_healthy
redis:
condition: service_started
healthcheck:
test: ['CMD', 'curl', 'localhost:9200']
interval: 5s
start_period: 5s
retries: 3
environment:
PORT: 9200
NODE_ENV: development
REDIS_HOST: redis
# USE_SINGLE_INSTANCE_CACHE: true
APP_BASE_URL: http://cdp-defra-id-stub.localtest.me:9200
REDIS_ENABLED: true
networks:
cdp-tenant:
aliases:
- cdp-defra-id-stub.localtest.me
################################################################################
volumes:
mongodb-data:
networks:
cdp-tenant:
driver: bridge