Skip to content

Commit

Permalink
Merge pull request #18 from gloddy-dev/infra/#16,17
Browse files Browse the repository at this point in the history
[Infra, Fix]: EC2 -> Fargate에 따른 ECS 태스크 정의 및 Dockerfile 수정
  • Loading branch information
jihwan2da authored Feb 19, 2024
2 parents 0066f52 + a9523e5 commit e6b9110
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 49 deletions.
2 changes: 1 addition & 1 deletion Dockerfile_STG
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ RUN apt-get update && apt-get install -y curl wget \
&& wget -O dd-java-agent.jar 'https://dtdg.co/latest-java-tracer' \
&& rm -rf /var/lib/apt/lists/*

ENTRYPOINT ["sh", "-c", "export TOKEN=$(curl -X PUT \"http://169.254.169.254/latest/api/token\" -H \"X-aws-ec2-metadata-token-ttl-seconds: 21600\") && export DD_AGENT_HOST=$(curl -H \"X-aws-ec2-metadata-token: $TOKEN\" http://169.254.169.254/latest/meta-data/local-ipv4) && java -javaagent:dd-java-agent.jar -Ddd.profiling.enabled=true -XX:FlightRecorderOptions=stackdepth=256 -Ddd.appsec.enabled=true -Ddd.iast.enabled=true -Ddd.logs.injection=true -Ddd.jmxfetch.enabled=true -Ddd.service=gloddy-community -Ddd.env=staging -jar app.jar"]
ENTRYPOINT ["java", "-javaagent:dd-java-agent.jar", "-Ddd.profiling.enabled=true", "-XX:FlightRecorderOptions=stackdepth=256", "-Ddd.appsec.enabled=true", "-Ddd.iast.enabled=true", "-Ddd.logs.injection=true", "-Ddd.jmxfetch.enabled=true", "-Ddd.service=gloddy-community", "-Ddd.env=staging", "-jar", "app.jar"]
63 changes: 15 additions & 48 deletions task-definition-stg.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"taskDefinitionArn": "arn:aws:ecs:ap-northeast-2:750773866215:task-definition/community-stg:18",
"taskDefinitionArn": "arn:aws:ecs:ap-northeast-2:750773866215:task-definition/community-stg:22",
"containerDefinitions": [
{
"name": "springboot",
Expand Down Expand Up @@ -48,6 +48,11 @@
"hostPort": 8126,
"protocol": "tcp",
"appProtocol": "http"
},
{
"containerPort": 8125,
"hostPort": 8125,
"protocol": "udp"
}
],
"essential": false,
Expand All @@ -67,27 +72,11 @@
],
"environmentFiles": [
{
"value": "arn:aws:s3:::gloddy-env/env/ec2-datadog.env",
"value": "arn:aws:s3:::gloddy-env/env/datadog.env",
"type": "s3"
}
],
"mountPoints": [
{
"sourceVolume": "docker_sock",
"containerPath": "/var/run/docker.sock",
"readOnly": true
},
{
"sourceVolume": "cgroup",
"containerPath": "/host/sys/fs/cgroup",
"readOnly": true
},
{
"sourceVolume": "proc",
"containerPath": "/host/proc",
"readOnly": true
}
],
"mountPoints": [],
"volumesFrom": [],
"logConfiguration": {
"logDriver": "awslogs",
Expand All @@ -102,30 +91,10 @@
}
],
"family": "community-stg",
"taskRoleArn": "arn:aws:iam::750773866215:role/ec2-role-for-ec2",
"executionRoleArn": "arn:aws:iam::750773866215:role/ecsTaskExecutionRole",
"networkMode": "awsvpc",
"revision": 18,
"volumes": [
{
"name": "docker_sock",
"host": {
"sourcePath": "/var/run/docker.sock"
}
},
{
"name": "proc",
"host": {
"sourcePath": "/proc/"
}
},
{
"name": "cgroup",
"host": {
"sourcePath": "/sys/fs/cgroup/"
}
}
],
"revision": 22,
"volumes": [],
"status": "ACTIVE",
"requiresAttributes": [
{
Expand All @@ -143,9 +112,6 @@
{
"name": "ecs.capability.env-files.s3"
},
{
"name": "com.amazonaws.ecs.capability.task-iam-role"
},
{
"name": "ecs.capability.execution-role-ecr-pull"
},
Expand All @@ -161,18 +127,19 @@
],
"placementConstraints": [],
"compatibilities": [
"EC2"
"EC2",
"FARGATE"
],
"requiresCompatibilities": [
"EC2"
"FARGATE"
],
"cpu": "512",
"memory": "819",
"memory": "1024",
"runtimePlatform": {
"cpuArchitecture": "X86_64",
"operatingSystemFamily": "LINUX"
},
"registeredAt": "2024-01-15T11:27:46.602Z",
"registeredAt": "2024-02-19T18:16:29.091Z",
"registeredBy": "arn:aws:iam::750773866215:root",
"tags": []
}

0 comments on commit e6b9110

Please sign in to comment.