-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
144 lines (135 loc) · 4.53 KB
/
docker-compose.yaml
File metadata and controls
144 lines (135 loc) · 4.53 KB
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
133
134
135
136
137
138
139
140
141
142
143
144
# NOTE::
# The services, settings and environment setup in this compose file is for DEVELOPMENT ONLY!
#
# It is intended to run the Apollo server in an "offline" mode. All data will be mocked.
#
networks:
dmptool-network:
driver: bridge
services:
# The database used by the Apollo server
mysql:
image: mysql:latest
container_name: apollo-mysql
ports:
- "3307:3306"
# - "3306:3306"
expose:
- 3307
environment:
- MYSQL_ROOT_PASSWORD=d0ckerSecr3t
- MYSQL_DATABASE=dmptool
networks:
- dmptool-network
volumes:
- ./docker/mysql:/var/lib/mysql
# The cache used by the Apollo server to store tokens
redis:
image: "public.ecr.aws/docker/library/redis:alpine"
container_name: apollo-redis
command: redis-server
networks:
- dmptool-network
ports:
- "6379:6379"
volumes:
- "./docker/redis:/var/lib/redis"
opensearch:
image: "opensearchproject/opensearch:1.3.0"
container_name: opensearch
environment:
- cluster.name=opensearch-cluster # Name the cluster
- cluster.routing.allocation.disk.threshold_enabled=false # Disable disk allocation threshold checks
- node.name=opensearch-node1 # Name the node that will run in this container
- discovery.type=single-node # 👈 Enables single-node mode
- bootstrap.memory_lock=true # Disable JVM heap memory swapping
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" # Set min and max JVM heap sizes
- "DISABLE_INSTALL_DEMO_CONFIG=true" # Prevents execution of bundled demo script which installs demo certificates and security configurations to OpenSearch
- "DISABLE_SECURITY_PLUGIN=true"
volumes:
- "./docker/opensearch:/usr/share/opensearch/data"
ports:
- 9200:9200 # REST API
- 9600:9600 # Performance Analyzer
networks:
- dmptool-network
# We use LocalStack to mock AWS services. We are using it to mock the DynamoDB
# table used to store the maDMP versions of Plans. Interactions between the
# Apollo server and DynamoDB are made via SQS messages that trigger Lambda
# functions.
#
# See the ./localstack-setup/init-aws.sh script for more details.
#
# Note: that because we are using the free version of LocalStack, the DynamoDB
# table, Lambda Function and SQS Queues do not persist between restarts.
localstack:
image: "localstack/localstack"
container_name: localstack
networks:
- dmptool-network
ports:
- "127.0.0.1:4566:4566" # LocalStack Gateway
- "127.0.0.1:4510-4559:4510-4559" # external services port range
environment:
# LocalStack configuration: https://docs.localstack.cloud/references/configuration/
- DEBUG=${DEBUG:-0}
- SERVICES=ses,sqs,lambda,ssm,logs,events,dynamodb
volumes:
- "./docker/localstack:/var/lib/localstack"
- "/var/run/docker.sock:/var/run/docker.sock"
# Load local Lambda code and init-aws.sh startup scripts
- "./localstack-setup:/etc/localstack/init/ready.d"
- "./lambdas:/etc/lambda-code"
# The Apollo server (GraphQL)
apollo:
container_name: apollo-server
depends_on:
mysql:
condition: service_started
redis:
condition: service_started
opensearch:
condition: service_started
localstack:
condition: service_healthy
build:
context: .
dockerfile: Dockerfile
ports:
- "4000:4000"
networks:
- dmptool-network
expose:
- 4000
env_file:
- .env
environment:
- "AWS_ACCESS_KEY_ID=DUMMYIDEXAMPLE"
- "AWS_SECRET_ACCESS_KEY=DUMMYEXAMPLEKEY"
- "REGION=us-west-2"
- "NODE_ENV=development"
# Local MySQL database
- "MYSQL_CONNECTION_LIMIT=5"
- "MYSQL_HOST=apollo-mysql"
- "MYSQL_PORT=3306"
- "MYSQL_DATABASE=dmptool"
- "MYSQL_USER=root"
- "MYSQL_PASSWORD=d0ckerSecr3t"
# Local Redis cache
- "CACHE_HOST=apollo-redis"
- "CACHE_PORT=6379"
- "CACHE_CONNECT_TIMEOUT=10000"
# OpenSearch
- "OPENSEARCH_HOST=opensearch"
- "OPENSEARCH_PORT=9200"
- "OPENSEARCH_USE_SSL=false"
- "OPENSEARCH_VERIFY_CERTS=false"
- "OPENSEARCH_AUTH_TYPE="
# LocalStack managed SQS queue
- "SQS_GENERATE_MADMP_QUEUE_URL=http://localstack:4566/000000000000/generateMaDMPRecord"
volumes:
- ".:/app"
# Mount the mysql certs directory so Apollo can see them
- "./docker/mysql/server-cert.pem:/etc/mysql-cert.pem:ro"
extra_hosts:
- "host.docker.internal:host-gateway"