-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.ecs.yml
87 lines (87 loc) · 2.2 KB
/
docker-compose.ecs.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
version: "3.3"
x-aws-vpc: "vpc-1aa52971"
x-aws-cluster: "codenalysis"
services:
nginx:
x-aws-policies:
- "arn:aws:iam::384777061532:role/aws-service-role/ecs.amazonaws.com/AWSServiceRoleForECS"
depends_on:
- web
restart: always
image: avthorn/codenalysis_nginx:latest
ports:
- 80:80
healthcheck:
test: ["CMD", "service", "nginx", "status", "|", "grep", "\\[ ok \\] nginx is running"]
interval: 1m30s
timeout: 10s
retries: 3
deploy:
x-aws-autoscaling: 80
resources:
limits:
cpus: '0.5'
memory: 128M
db:
x-aws-policies:
- "arn:aws:iam::384777061532:role/aws-service-role/ecs.amazonaws.com/AWSServiceRoleForECS"
restart: always
image: avthorn/codenalysis_db:latest
environment:
MYSQL_ROOT_PASSWORD: root
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "--silent"]
interval: 1m30s
timeout: 10s
retries: 3
deploy:
x-aws-autoscaling: 80
resources:
limits:
cpus: '0.5'
memory: 512M
web:
x-aws-policies:
- "arn:aws:iam::384777061532:role/aws-service-role/ecs.amazonaws.com/AWSServiceRoleForECS"
restart: always
depends_on:
- api
image: avthorn/codenalysis_web:latest
environment:
NODE_ENV: production
HOST: 0.0.0.0
PORT: '3000'
healthcheck:
test: ["CMD", "ps", "aux", "|", "grep", "start.js"]
interval: 1m30s
timeout: 10s
retries: 3
deploy:
x-aws-autoscaling: 80
resources:
limits:
cpus: '0.5'
memory: 512M
api:
x-aws-policies:
- "arn:aws:iam::384777061532:role/aws-service-role/ecs.amazonaws.com/AWSServiceRoleForECS"
depends_on:
- db
restart: always
image: avthorn/codenalysis_api:latest
environment:
FLASK_ENV: production
healthcheck:
test: ["CMD", "!", "curl", "http://localhost/api/v1/healthcheck", "|", "grep", "NOT OK"]
interval: 1m30s
timeout: 10s
retries: 3
deploy:
x-aws-autoscaling: 80
resources:
limits:
cpus: '1'
memory: 512M
secrets:
credentials:
file: ./secrets.env