Skip to content

Commit 04340e8

Browse files
committed
update Dockerfile and ecs task definition
1 parent 17ea520 commit 04340e8

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed

sca-image/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ COPY . /app
66
RUN chown -R johnnycodev:johnnycodev /app
77
USER johnnycodev
88
CMD node index.js
9+
EXPOSE 80

terraform/.gitignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Local .terraform directories
2+
**/.terraform/*
3+
4+
# .tfstate files
5+
*.tfstate
6+
*.tfstate.*
7+
8+
# Crash log files
9+
crash.log
10+
crash.*.log
11+
12+
# Exclude all .tfvars files, which are likely to contain sensitive data, such as
13+
# password, private keys, and other secrets. These should not be part of version
14+
# control as they are data points which are potentially sensitive and subject
15+
# to change depending on the environment.
16+
*.tfvars
17+
*.tfvars.json
18+
19+
# Ignore override files as they are usually used to override resources locally and so
20+
# are not checked in
21+
override.tf
22+
override.tf.json
23+
*_override.tf
24+
*_override.tf.json
25+
26+
# Include override files you do wish to add to version control using negated pattern
27+
# !example_override.tf
28+
29+
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
30+
# example: *tfplan*
31+
32+
# Ignore CLI configuration files
33+
.terraformrc
34+
terraform.rc

terraform/ecs.tf

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
resource "aws_ecs_task_definition" "service" {
2+
family = "service"
3+
container_definitions = jsonencode([
4+
{
5+
name = "first"
6+
image = "nginx"
7+
cpu = 10
8+
memory = 512
9+
essential = true
10+
portMappings = [
11+
{
12+
containerPort = 80
13+
hostPort = 80
14+
}
15+
]
16+
},
17+
{
18+
name = "second"
19+
image = "python:3.9-alpine"
20+
cpu = 10
21+
memory = 256
22+
essential = true
23+
portMappings = [
24+
{
25+
containerPort = 443
26+
hostPort = 443
27+
}
28+
]
29+
}
30+
])
31+
}

0 commit comments

Comments
 (0)