forked from amazon-archives/ecs-cloudwatch-logs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
cloudwatchlogs.json
50 lines (50 loc) · 1.66 KB
/
cloudwatchlogs.json
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
{
"volumes": [
{
"name": "ecs_instance_logs",
"host": {
"sourcePath": "/var/log"
}
}
],
"containerDefinitions": [
{
"environment": [],
"name": "cloudwatchlogs",
"image": "schmutze/cloudwatchlogs",
"cpu": 50,
"portMappings": [],
"memory": 64,
"essential": true,
"mountPoints": [
{
"sourceVolume": "ecs_instance_logs",
"containerPath": "/mnt/ecs_instance_logs",
"readOnly": true
}
]
},
{
"environment": [],
"name": "httpd",
"links": [
"cloudwatchlogs"
],
"image": "httpd",
"cpu": 50,
"portMappings": [
{
"containerPort": 80,
"hostPort": 80
}
],
"memory": 128,
"entryPoint": ["/bin/bash", "-c"],
"command": [
"apt-get update && apt-get -y install wget && echo 'CustomLog \"| /usr/bin/logger -t httpd -p local6.info -n cloudwatchlogs -P 514\" \"%v %h %l %u %t %r %>s %b %{Referer}i %{User-agent}i\"' >> /usr/local/apache2/conf/httpd.conf && echo 'ErrorLogFormat \"%v [%t] [%l] [pid %P] %F: %E: [client %a] %M\"' >> /usr/local/apache2/conf/httpd.conf && echo 'ErrorLog \"| /usr/bin/logger -t httpd -p local7.info -n cloudwatchlogs -P 514\"' >> /usr/local/apache2/conf/httpd.conf && echo ServerName `hostname` >> /usr/local/apache2/conf/httpd.conf && rm -rf /usr/local/apache2/htdocs/* && cd /usr/local/apache2/htdocs && wget -mkEpnp -nH --cut-dirs=4 http://docs.aws.amazon.com/AmazonECS/latest/developerguide/Welcome.html && /usr/local/bin/httpd-foreground"
],
"essential": true
}
],
"family": "cloudwatchlogs"
}