This repository was archived by the owner on Apr 10, 2021. It is now read-only.
forked from awslabs/ecs-refarch-continuous-deployment
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathservice.yaml
More file actions
187 lines (158 loc) · 4.54 KB
/
Copy pathservice.yaml
File metadata and controls
187 lines (158 loc) · 4.54 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
Parameters:
Tag:
Type: String
Default: latest
DesiredCount:
Type: Number
Default: 0
Cluster:
Type: String
Repository:
Type: String
LETSENCRYPTEMAIL:
Type: String
LETSENCRYPTHOST:
Type: String
CONTAINERPORT:
Type: Number
FACEBOOKCLIENTSECRET:
Type: String
FACEBOOKCLIENTID:
Type: String
FACEBOOKCALLBACKURL:
Type: String
FACEBOOKAPI:
Type: String
GOOGLECLIENTSECRET:
Type: String
GOOGLECLIENTID:
Type: String
GOOGLECALLBACKURL:
Type: String
GOOGLEBROWSERKEY:
Type: String
GOOGLESERVERKEY:
Type: String
GAPROPERTY:
Type: String
GADOMAIN:
Type: String
TWITTERCONSUMERKEY:
Type: String
TWITTERCONSUMERSECRET:
Type: String
TWITTERCALLBACKURL:
Type: String
CLOUDINARYURL:
Type: String
MAILGUNAPIKEY:
Type: String
MAILGUNDOMAIN:
Type: String
COOKIESECRET:
Type: String
Resources:
ECSServiceRole:
Type: AWS::IAM::Role
Properties:
RoleName: !Sub ecs-service-${AWS::StackName}
Path: /
AssumeRolePolicyDocument: |
{
"Statement": [{
"Effect": "Allow",
"Principal": { "Service": [ "ecs.amazonaws.com" ]},
"Action": [ "sts:AssumeRole" ]
}]
}
ManagedPolicyArns:
- arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceRole
Service:
Type: AWS::ECS::Service
Properties:
Cluster: !Ref Cluster
DeploymentConfiguration:
MaximumPercent: 150
MinimumHealthyPercent: 0
DesiredCount: !Ref DesiredCount
TaskDefinition: !Ref TaskDefinition
TaskDefinition:
Type: AWS::ECS::TaskDefinition
Properties:
Family: !Sub ${AWS::StackName}-node-app
ContainerDefinitions:
- Name: node-app
Image: !Sub ${AWS::AccountId}.dkr.ecr.${AWS::Region}.amazonaws.com/${Repository}:${Tag}
EntryPoint:
- npm
- start
Essential: true
MemoryReservation: 128
Links:
- mongodb:mongodb
PortMappings:
- ContainerPort: !Ref CONTAINERPORT
Environment:
- Name: Tag
Value: !Ref Tag
- Name: NODE_ENV
Value: 'production'
- Name: PORT
Value: !Ref CONTAINERPORT
- Name: MONGO_URI
Value: !Sub mongodb://mongodb/${Repository}
- Name: FACEBOOK_CLIENT_SECRET
Value: !Ref FACEBOOKCLIENTSECRET
- Name: GOOGLE_CALLBACK_URL
Value: !Ref GOOGLECALLBACKURL
- Name: CLOUDINARY_URL
Value: !Ref CLOUDINARYURL
- Name: MAILGUN_API_KEY
Value: !Ref MAILGUNAPIKEY
- Name: MAILGUN_DOMAIN
Value: !Ref MAILGUNDOMAIN
- Name: GOOGLE_CLIENT_ID
Value: !Ref GOOGLECLIENTID
- Name: FACEBOOK_CLIENT_ID
Value: !Ref FACEBOOKCLIENTID
- Name: FACEBOOK_CALLBACK_URL
Value: !Ref FACEBOOKCALLBACKURL
- Name: GOOGLE_CLIENT_SECRET
Value: !Ref GOOGLECLIENTSECRET
- Name: FACEBOOK_API
Value: !Ref FACEBOOKAPI
- Name: COOKIE_SECRET
Value: !Ref COOKIESECRET
- Name: LETSENCRYPT_EMAIL
Value: !Ref LETSENCRYPTEMAIL
- Name: LETSENCRYPT_HOST
Value: !Ref LETSENCRYPTHOST
- Name: VIRTUAL_PORT
Value: !Ref CONTAINERPORT
- Name: VIRTUAL_HOST
Value: !Ref LETSENCRYPTHOST
- Name: GOOGLE_BROWSER_KEY
Value: !Ref GOOGLEBROWSERKEY
- Name: GOOGLE_SERVER_KEY
Value: !Ref GOOGLESERVERKEY
- Name: GA_PROPERTY
Value: !Ref GAPROPERTY
- Name: GA_DOMAIN
Value: !Ref GADOMAIN
- Name: TWITTER_CONSUMER_KEY
Value: !Ref TWITTERCONSUMERKEY
- Name: TWITTER_CALLBACK_URL
Value: !Ref TWITTERCALLBACKURL
- Name: TWITTER_CONSUMER_SECRET
Value: !Ref TWITTERCONSUMERSECRET
- Name: mongodb
Image: mongo:3.4
Essential: true
MemoryReservation: 128
MountPoints:
- SourceVolume: !Sub ${AWS::StackName}-MongoDB-Vol
ContainerPath: /data/db
Volumes:
- Name: !Sub ${AWS::StackName}-MongoDB-Vol
Host:
SourcePath: /opt/docker/benggdata