-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
97 lines (96 loc) · 2.61 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
version: "3.8"
services:
dynamodb-local:
command: "-jar DynamoDBLocal.jar -sharedDb -dbPath ./data"
image: "amazon/dynamodb-local:latest"
container_name: "dynamodb-local"
volumes:
- db_data:/home/dynamodblocal/data
working_dir: /home/dynamodblocal
ports:
- "8000:8000"
user: root
dynamodb-maint:
depends_on:
- "dynamodb-local"
links:
- "dynamodb-local"
environment:
- AWS_PROFILE=nj-default
volumes:
- ~/.aws/credentials:/root/.aws/credentials:ro
- type: bind
source: ./api/users-dynamodb-schema.json
target: /users-dynamodb-schema.json
- type: bind
source: ./api/businesses-dynamodb-schema.json
target: /businesses-dynamodb-schema.json
image: amazon/aws-cli
command: >
/bin/sh -c "
dynamodb create-table --cli-input-json file:///users-dynamodb-schema.json --endpoint-url http://dynamodb-local:8000 --region us-east-1
dynamodb create-table --cli-input-json file:///businesses-dynamodb-schema.json --endpoint-url http://dynamodb-local:8000 --region us-east-1
"
dynamodb-admin:
image: aaronshaf/dynamodb-admin
links:
- "dynamodb-local"
ports:
- 8008:8001
environment:
- DYNAMO_ENDPOINT=http://dynamodb-local:8000
wiremock:
image: node:14.18-slim
volumes:
- ./api:/api
- wiremock_modules:/root/.jdeploy
- api_node_modules:/api/node_modules
ports:
- "9000:9000"
working_dir: /api
command: bash -c "npm install && npm run start:wiremock"
api:
depends_on:
- wiremock
- "dynamodb-local"
links:
- wiremock
- "dynamodb-local"
image: node:14.18-slim
volumes:
- ~/.aws/credentials:/root/.aws/credentials:ro
- ./api:/api
- ./scripts:/scripts
- api_node_modules:/api/node_modules
ports:
- "5002:5002"
working_dir: /api
environment:
- AWS_PROFILE=nj-default
- IS_DOCKER=true
command: bash -c "npx wait-on tcp:wiremock:9000 && npm run start"
# this is waiting on wiremock as the npm installation for the api folder is executed there.
web:
depends_on:
- api
image: node:14.18-slim
stdin_open: true
links:
- api
volumes:
- ./web:/web
- web_node_modules:/web/node_modules
- /web/.next
- ./scripts:/scripts
- npm_logs:/root/.npm/_logs
ports:
- "3000:3000"
working_dir: /web
command: bash -c "npm install --no-optional && npm run dev"
volumes:
npm_logs: {}
db_data: {}
next_data: {}
web_node_modules: {}
api_node_modules: {}
wiremock_modules: {}