Skip to content

Commit 46dc486

Browse files
committed
Added Gunicorn, Kibana, Tomcat
1 parent dd1e851 commit 46dc486

File tree

10 files changed

+312
-0
lines changed

10 files changed

+312
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ The task definitions in this repository are for popular applications whose code
66
## Directory
77
* [nginx](/nginx)
88
* [Wildfly](/wildfly)
9+
* [Tomcat](/tomcat)
10+
* [Gunicorn](/gunicorn)
11+
* [Kibana](/kibana)
912

1013
## Getting Started
1114
To run task definitions in this repository you must:

gunicorn/REAMDE.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Gunicorn
2+
Gunicorn is a Python WSGI HTTP Server for UNIX which uses a pre-fork worker model, ported from Ruby's Unicorn project A central master process manages the workers and all requests are handled by worker processes.
3+
4+
The sources are distributed under the MIT License
5+
Learn more: [https://github.com/benoitc/gunicorn/blob/master/LICENSE](https://github.com/benoitc/gunicorn/blob/master/LICENSE)
6+
7+
## Using this Task Definition
8+
This task definition pulls a sample Gunicorn image from [DockerHub](https://hub.docker.com/r/danriti/gunicorn-flask/).
9+
10+
### Steps to Run:
11+
* Have an active [AWS account](https://portal.aws.amazon.com/billing/signup#/start).
12+
* Create an [Amazon ECS cluster](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/create_cluster.html).
13+
* This task definition is a template that can then be pasted into the AWS console JSON input area or saved to a file and used with the AWS CLI. You can easily replace the existing Docker image in this task definition with your own.
14+
* Run the task definition as a [Task](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/scheduling_tasks.html) or [Service](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html).
15+
16+
#### ECS CLI Commands
17+
`aws ecs register-task-definition --cli-input-json file://<path_to_json_file>/gunicorn.json`
18+
19+
## More Info
20+
#### What is a Task Definition?
21+
A task definition is required to run Docker containers in Amazon ECS. Some of the parameters you can specify in a task definition include:
22+
23+
* Which Docker images to use with the containers in your task.
24+
* How much CPU and memory to use with each container.
25+
* The Docker networking mode to use for the containers in your task.
26+
27+
Please see the [Amazon ECS Documentation](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html) for more information on writing and running Task Definitions.
28+
29+
#### About Amazon ECS
30+
Amazon EC2 Container Service (Amazon ECS) is a container management service that supports Docker containers and allows you to easily run applications on a managed cluster of Amazon EC2 instances. Amazon ECS eliminates the need for you to install, operate, and scale your own cluster management infrastructure. Learn more [here](https://aws.amazon.com/ecs).
31+
32+
#### Getting Help
33+
* [Amazon ECS Documentation](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/Welcome.html)
34+
* [Amazon ECS Developer Forum](https://forums.aws.amazon.com/forum.jspa?forumID=187)
35+
* [Stack Overflow](https://stackoverflow.com/questions/tagged/amazon-ecs)
36+
* [AWS Support](https://aws.amazon.com/premiumsupport/)

gunicorn/gunicorn_ec2.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"networkMode": "awsvpc",
3+
"family": "gunicorn",
4+
"containerDefinitions": [
5+
{
6+
"memory": 256,
7+
"portMappings": [
8+
{
9+
"hostPort": 5000,
10+
"containerPort": 5000,
11+
"protocol": "tcp"
12+
}
13+
],
14+
"essential": true,
15+
"name": "gunicorn",
16+
"environment": [],
17+
"image": "danriti/gunicorn-flask",
18+
"logConfiguration": {
19+
"logDriver": "awslogs",
20+
"options": {
21+
"awslogs-group": "/ecs/gunicorn",
22+
"awslogs-region": "us-west-2",
23+
"awslogs-stream-prefix": "ecs"
24+
}
25+
}
26+
}
27+
]
28+
}

gunicorn/gunicorn_fargate.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"memory":"1024",
3+
"networkMode":"awsvpc",
4+
"cpu":"512",
5+
"family":"gunicorn",
6+
"containerDefinitions":[
7+
{
8+
"portMappings":[
9+
{
10+
"hostPort":5000,
11+
"containerPort":5000,
12+
"protocol":"tcp"
13+
}
14+
],
15+
"essential":true,
16+
"name":"gunicorn",
17+
"environment":[
18+
19+
],
20+
"image":"danriti/gunicorn-flask",
21+
"logConfiguration":{
22+
"logDriver":"awslogs",
23+
"options":{
24+
"awslogs-group":"/ecs/gunicorn",
25+
"awslogs-region":"us-west-2",
26+
"awslogs-stream-prefix":"ecs"
27+
}
28+
},
29+
"memoryReservation":1024
30+
}
31+
]
32+
}

kibana/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Kibana
2+
Kibana is an open source plugin for Elasticsearch which can be used to visualize Elasticsearch data and navigate the Elastic Stack. Core Kibana ships with histograms, line graphs, pie charts, sunbursts, and more.
3+
4+
The sources and documentation are distributed under the Apache License, Version 2.0.
5+
Learn more: [https://www.elastic.co/products/kibana](https://www.elastic.co/products/kibana)
6+
7+
## Using this Task Definition
8+
This task definition pulls the maintained Kibana image from [DockerHub](https://hub.docker.com/_/kibana/).
9+
10+
### Steps to Run:
11+
* Have an active [AWS account](https://portal.aws.amazon.com/billing/signup#/start).
12+
* Create an [Amazon ECS cluster](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/create_cluster.html).
13+
* This task definition is a template that can then be pasted into the AWS console JSON input area or saved to a file and used with the AWS CLI. It is imortant to replace the <ES-URL>-part of this task template with an actual Elasticsearch-URL.
14+
* Run the task definition as a [Task](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/scheduling_tasks.html) or [Service](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html).
15+
16+
#### ECS CLI Commands
17+
`aws ecs register-task-definition --cli-input-json file://<path_to_json_file>/kibana.json`
18+
19+
## More Info
20+
#### What is a Task Definition?
21+
A task definition is required to run Docker containers in Amazon ECS. Some of the parameters you can specify in a task definition include:
22+
23+
* Which Docker images to use with the containers in your task.
24+
* How much CPU and memory to use with each container.
25+
* The Docker networking mode to use for the containers in your task.
26+
27+
Please see the [Amazon ECS Documentation](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html) for more information on writing and running Task Definitions.
28+
29+
#### About Amazon ECS
30+
Amazon EC2 Container Service (Amazon ECS) is a container management service that supports Docker containers and allows you to easily run applications on a managed cluster of Amazon EC2 instances. Amazon ECS eliminates the need for you to install, operate, and scale your own cluster management infrastructure. Learn more [here](https://aws.amazon.com/ecs).
31+
32+
#### Getting Help
33+
* [Amazon ECS Documentation](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/Welcome.html)
34+
* [Amazon ECS Developer Forum](https://forums.aws.amazon.com/forum.jspa?forumID=187)
35+
* [Stack Overflow](https://stackoverflow.com/questions/tagged/amazon-ecs)
36+
* [AWS Support](https://aws.amazon.com/premiumsupport/)

kibana/kibana_ec2.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"networkMode":"bridge",
3+
"containerDefinitions":[
4+
{
5+
"volumesFrom":[
6+
7+
],
8+
"portMappings":[
9+
{
10+
"hostPort":80,
11+
"containerPort":5601,
12+
"protocol":"tcp"
13+
}
14+
],
15+
"essential":true,
16+
"name":"kibana",
17+
"environment":[
18+
{
19+
"name":"ELASTICSEARCH_URL",
20+
"value":"<ES-URL>"
21+
}
22+
],
23+
"image":"docker.elastic.co/kibana/kibana:6.0.0",
24+
"logConfiguration":{
25+
"logDriver":"awslogs",
26+
"options":{
27+
"awslogs-group":"kibana-logs",
28+
"awslogs-region":"us-west-2"
29+
}
30+
},
31+
"cpu":1024,
32+
"memoryReservation":1024
33+
}
34+
],
35+
"family":"kibana"
36+
}

kibana/kibana_fargate.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"memory":"2048",
3+
"networkMode":"awsvpc",
4+
"cpu":"1024",
5+
"family":"kibana",
6+
"containerDefinitions":[
7+
{
8+
"portMappings":[
9+
{
10+
"hostPort":5601,
11+
"containerPort":5601,
12+
"protocol":"tcp"
13+
}
14+
],
15+
"essential":true,
16+
"name":"kibana",
17+
"environment":[
18+
{
19+
"name":"ELASTICSEARCH_URL",
20+
"value":"<ES-URL>"
21+
}
22+
],
23+
"image":"docker.elastic.co/kibana/kibana:6.0.0",
24+
"logConfiguration":{
25+
"logDriver":"awslogs",
26+
"options":{
27+
"awslogs-group":"/ecs/kibana",
28+
"awslogs-region":"us-west-2",
29+
"awslogs-stream-prefix":"ecs"
30+
}
31+
},
32+
"memoryReservation":1024
33+
}
34+
]
35+
}

tomcat/readme.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# APACHE TOMCAT
2+
The Apache Tomcat® software is an open source implementation of the Java Servlet, JavaServer Pages, Java Expression Language and Java WebSocket technologies.
3+
The sources and documentation are distributed under the 2-clause BSD-like license.
4+
Learn more: http://tomcat.apache.org/
5+
6+
The Apache Tomcat software is developed in an open and participatory environment and released under the Apache License version 2.
7+
8+
## Using this Task Definition
9+
This task definition pulls the maintained tomcat image from [DockerHub](https://hub.docker.com/_/tomcat/).
10+
11+
### Steps to Run:
12+
* Have an active [AWS account](https://portal.aws.amazon.com/billing/signup#/start).
13+
* Create an [Amazon ECS cluster](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/create_cluster.html).
14+
* This task definition is a template that can then be pasted into the AWS console JSON input area or saved to a file and used with the AWS CLI.
15+
* Run the task definition as a [Task](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/scheduling_tasks.html) or [Service](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html).
16+
17+
#### ECS CLI Commands
18+
19+
To register the task definition, download the json file from this repo and save at some loction on the local disk on your machine. Then run the below command from the command line. You wil need to have the aws cli already configured in order to run this command. Please follow the instructions to setup AWS CLI are [here](http://docs.aws.amazon.com/cli/latest/userguide/installing.html).
20+
21+
Note - This task definition assumes that you have a CloudWatch Log Group named 'tomcat-container-logs' already created. If you want to write to a different Log Group, then change the task definition accordingly.
22+
23+
`aws ecs register-task-definition --cli-input-json file://<path_to_json_file>/tomcat-task-def.json`
24+
25+
26+
To run one instance of this task on an existing ECS Cluster:
27+
28+
`aws ecs run-task --cluster <YOUR_CLUSTER_NAME> --task-definition tomcat-webserver:1 --count 1`
29+
30+
Replace the <YOUR_CLUSTER_NAME> with the actual name of your ECS cluster. Also, if you have changed the name of the task, then change the same in the above command accordingly.
31+
32+
## More Info
33+
#### What is a Task Definition?
34+
A task definition is required to run Docker containers in Amazon ECS. Some of the parameters you can specify in a task definition include:
35+
36+
* Which Docker images to use with the containers in your task.
37+
* How much CPU and memory to use with each container.
38+
* The Docker networking mode to use for the containers in your task.
39+
40+
Please see the [Amazon ECS Documentation](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html) for more information on writing and running Task Definitions.
41+
42+
#### About Amazon ECS
43+
Amazon EC2 Container Service (Amazon ECS) is a container management service that supports Docker containers and allows you to easily run applications on a managed cluster of Amazon EC2 instances. Amazon ECS eliminates the need for you to install, operate, and scale your own cluster management infrastructure. Learn more [here](https://aws.amazon.com/ecs).
44+
45+
#### Getting Help
46+
* [Amazon ECS Documentation](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/Welcome.html)
47+
* [Amazon ECS Developer Forum](https://forums.aws.amazon.com/forum.jspa?forumID=187)
48+
* [Stack Overflow](https://stackoverflow.com/questions/tagged/amazon-ecs)
49+
* [AWS Support](https://aws.amazon.com/premiumsupport/)

tomcat/tomcat_ec2.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"containerDefinitions": [
3+
{
4+
"essential": true,
5+
"name": "tomcat-webserver",
6+
"image": "tomcat",
7+
"memory": 256,
8+
"cpu": 1024,
9+
"portMappings": [
10+
{
11+
"hostPort": 80,
12+
"containerPort": 8080,
13+
"protocol": "tcp"
14+
}
15+
],
16+
"logConfiguration": {
17+
"logDriver": "awslogs",
18+
"options": {
19+
"awslogs-group": "tomcat-container-logs",
20+
"awslogs-region": "us-west-2"
21+
}
22+
}
23+
}
24+
],
25+
"family": "tomcat-webserver",
26+
"volumes": []
27+
}

tomcat/tomcat_fargate.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"containerDefinitions": [
3+
{
4+
"logConfiguration": {
5+
"logDriver": "awslogs",
6+
"options": {
7+
"awslogs-group": "/ecs/tomcat-container-logs",
8+
"awslogs-region": "us-west-2",
9+
"awslogs-stream-prefix": "ecs"
10+
}
11+
},
12+
"portMappings": [
13+
{
14+
"hostPort": 8080,
15+
"protocol": "tcp",
16+
"containerPort": 8080
17+
}
18+
],
19+
"cpu": 1024,
20+
"memory": 256,
21+
"image": "tomcat",
22+
"essential": true,
23+
"name": "tomcat-webserver"
24+
}
25+
],
26+
"memory": "2048",
27+
"family": "tomcat-webserver",
28+
"networkMode": "awsvpc",
29+
"cpu": "1024"
30+
}

0 commit comments

Comments
 (0)