-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.yaml
100 lines (88 loc) · 2.77 KB
/
docker-compose.yaml
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
version: '3'
volumes:
local:
driver: local
driver_opts:
type: 'none'
o: 'bind'
device: '${PWD}'
services:
#########################################################################
#
# Prerequisite Services/Images
#
#########################################################################
# AWS SAM CLI
aws-sam:
image: aws-sam
build:
context: .
dockerfile: .dockerfiles/Dockerfile.sam
args:
- AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION}
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
env_file: .env
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- "local:/var/opt"
command: --version
# AWS CLI
aws-cli:
image: aws-cli
build:
context: .
dockerfile: .dockerfiles/Dockerfile.aws
args:
- AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION}
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
env_file: .env
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- "local:/var/opt"
command: --version
#########################################################################
#
# Command Services
#
#########################################################################
# Package template via AWS SAM CLI
aws-sam-package:
image: aws-sam
command: package --template-file template.yaml --output-template-file packaged.yaml --s3-bucket ${S3_BUCKET}
env_file: .env
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- "local:/var/opt"
# Deploy packaged project via AWS SAM CLI
aws-sam-deploy:
image: aws-sam
command: deploy --template-file packaged.yaml --stack-name mewconnect-handshake-server --capabilities CAPABILITY_IAM --parameter-overrides TwilioID=${TWILIO_ID} TwilioToken=${TWILIO_TOKEN} TwilioTTL=${TWILIO_TTL}
env_file: .env
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- "local:/var/opt"
# Get cloudformation via AWS CLI
aws-cli-cloudformation:
image: aws-cli
command: cloudformation describe-stacks --stack-name mewconnect-handshake-server --query 'Stacks[].Outputs'
env_file: .env
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- "local:/var/opt"
#########################################################################
#
# Dev Commands
#
#########################################################################
# Start a locally-hosted lambda API
aws-sam-local:
image: aws-sam
command: local start-api --docker-volume-basedir ./ --host 0.0.0.0
ports:
- '3000:3000'
env_file: .env
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- "local:/var/opt"