-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
49 lines (47 loc) · 1.53 KB
/
Copy pathdocker-compose.yml
File metadata and controls
49 lines (47 loc) · 1.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
services:
app:
build: .
ports:
- "3000:3000"
env_file:
- .env
environment:
- DYNAMODB_ENDPOINT=http://dynamodb-local:8000
- DYNAMODB_TABLE=reference-architecture
- TENANT_RESOLUTION_MODE=fixed
- AUTH_PROVIDER=internal_magic_link
- APP_TENANT_ID=reference-architecture-local
- AWS_REGION=us-east-1
depends_on:
dynamodb-local:
condition: service_started
dynamodb-setup:
condition: service_completed_successfully
dynamodb-local:
image: amazon/dynamodb-local:latest
ports:
- "8000:8000"
command: ["-jar", "DynamoDBLocal.jar", "-inMemory"]
dynamodb-setup:
image: amazon/aws-cli:latest
environment:
- AWS_ACCESS_KEY_ID=dummy
- AWS_SECRET_ACCESS_KEY=dummy
- AWS_DEFAULT_REGION=us-east-1
depends_on:
- dynamodb-local
entrypoint: ["/bin/sh", "-c"]
command:
- |
for i in $$(seq 1 20); do
aws dynamodb list-tables --endpoint-url http://dynamodb-local:8000 > /dev/null 2>&1 && break
echo "Waiting for DynamoDB Local ($$i)..."
sleep 1
done
aws dynamodb create-table \
--endpoint-url http://dynamodb-local:8000 \
--table-name reference-architecture \
--attribute-definitions AttributeName=PK,AttributeType=S AttributeName=SK,AttributeType=S \
--key-schema AttributeName=PK,KeyType=HASH AttributeName=SK,KeyType=RANGE \
--billing-mode PAY_PER_REQUEST \
|| echo "Table already exists, skipping"