Skip to content

Commit f5f9fb1

Browse files
committed
nginx on port 80 and add links for beanstalk
1 parent 8eaf972 commit f5f9fb1

File tree

7 files changed

+29
-14
lines changed

7 files changed

+29
-14
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ build/*
66
!bin/*.sh
77
lib
88
task-definition/scorekeep-task-definition.json
9+
.elasticbeanstalk/*
10+

cloudformation/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,11 @@ check-region:
88
stack: check-region
99
aws --region $(AWS_REGION) cloudformation create-stack --stack-name scorekeep --capabilities "CAPABILITY_NAMED_IAM" --template-body file://cf-resources.yaml
1010

11+
update: check-region
12+
aws --region $(AWS_REGION) cloudformation update-stack --stack-name scorekeep --capabilities "CAPABILITY_NAMED_IAM" --template-body file://cf-resources.yaml
13+
14+
check: check-region
15+
aws --region $(AWS_REGION) cloudformation describe-stack-events --stack-name scorekeep --max-items 4
16+
1117
clean: check-region
1218
aws --region $(AWS_REGION) cloudformation delete-stack --stack-name scorekeep

scorekeep-frontend/nginx.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ http {
2020
}
2121

2222
server {
23-
listen 8080 default_server;
23+
listen 80 default_server;
2424
root /public;
2525

2626
location / {
2727
}
2828

2929
location /api {
30-
proxy_pass http://127.0.0.1:5000;
30+
proxy_pass http://scorekeep-api:5000;
3131
proxy_http_version 1.1;
3232

3333
proxy_set_header Connection $connection_upgrade;

scorekeep-frontend/public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<h3 class="masthead-brand"><a href="#/" id="scorekeep-anchor">Scorekeep</a></h3>
4646
<nav class="nav nav-masthead">
4747
<a class="nav-link" href='#/' onclick="showhide('instructions');return false;">Instructions</a>
48-
<a class="nav-link" target="blank" href="https://aws.amazon.com/ecs/">Powered by AWS Fargate</a>
48+
<a class="nav-link" target="blank" href="https://aws.amazon.com/ecs/">Powered by Amazon ECS</a>
4949
</nav>
5050
</div>
5151
</div>

task-definition/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
# Elastic Beanstalk Files
3+
.elasticbeanstalk/*
4+
!.elasticbeanstalk/*.cfg.yml
5+
!.elasticbeanstalk/*.global.yml

task-definition/generate-task-definition

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
66
TASK_DEFINITION_INPUT_FILE="scorekeep-task-definition.template"
77
TASK_DEFINITION_INPUT_PATH="${DIR}/template/${TASK_DEFINITION_INPUT_FILE}"
88

9-
TASK_DEFINITION_OUTPUT_FILE="scorekeep-task-definition.json"
9+
TASK_DEFINITION_OUTPUT_FILE="Dockerrun.aws.json"
1010
TASK_DEFINITION_OUTPUT_PATH="${DIR}/${TASK_DEFINITION_OUTPUT_FILE}"
1111

1212
PARAMETERS_FILE="../aws.env"

task-definition/template/scorekeep-task-definition.template

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
{
2+
"AWSEBDockerrunVersion": 2,
23
"family": "scorekeep",
3-
"networkMode":"awsvpc",
4-
"containerDefinitions": [
4+
"containerDefinitions": [
55
{
6-
"name": "scorekeep-frontend",
6+
"name": "scorekeep-frontend",
77
"image": "$$ACCOUNT_ID$$.dkr.ecr.$$REGION$$.amazonaws.com/scorekeep-frontend",
8-
"cpu": 256,
8+
"cpu": 64,
99
"memoryReservation": 512,
1010
"portMappings" : [
1111
{
12-
"containerPort": 8080
12+
"hostPort": 80,
13+
"containerPort": 80
1314
}
1415
],
16+
"links": [
17+
"scorekeep-api"
18+
],
1519
"logConfiguration": {
1620
"logDriver": "awslogs",
1721
"options": {
@@ -22,16 +26,17 @@
2226
}
2327
},
2428
{
25-
"name": "scopekeep-api",
29+
"name": "scorekeep-api",
2630
"image": "$$ACCOUNT_ID$$.dkr.ecr.$$REGION$$.amazonaws.com/scorekeep-api",
27-
"cpu": 768,
31+
"cpu": 192,
2832
"memoryReservation": 512,
2933
"environment": [
3034
{ "name" : "AWS_REGION", "value" : "$$REGION$$" },
3135
{ "name" : "NOTIFICATION_TOPIC", "value" : "arn:aws:sns:$$REGION$$:$$ACCOUNT_ID$$:scorekeep-notifications" }
3236
],
3337
"portMappings" : [
3438
{
39+
"hostPort": 5000,
3540
"containerPort": 5000
3641
}
3742
],
@@ -47,9 +52,6 @@
4752
],
4853
"executionRoleArn": "arn:aws:iam::$$ACCOUNT_ID$$:role/scorekeepExecutionRole",
4954
"taskRoleArn": "arn:aws:iam::$$ACCOUNT_ID$$:role/scorekeepRole",
50-
"requiresCompatibilities": [
51-
"FARGATE"
52-
],
5355
"cpu": ".25 vcpu",
5456
"memory": "1 gb"
5557
}

0 commit comments

Comments
 (0)