From e7f0205d4b52ec19dae20e1f7c2c1268f8b6b30f Mon Sep 17 00:00:00 2001 From: Daniel Trolezi Date: Mon, 23 Sep 2024 16:19:15 -0300 Subject: [PATCH] Set nginx logs to stdout and configure a ecs task role --- .github/workflows/ci-cd.yml | 1 + docker/nginx/default.conf | 4 ++-- ecs/deployment-task.json | 11 ++++++----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 0e64f41..322b88d 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -62,6 +62,7 @@ jobs: - name: Update ECS task definition run: | sed -i 's||${{ secrets.ECS_TASK_EXEC_ROLE }}|' ./ecs/deployment-task.json + sed -i 's||${{ secrets.ECS_TASK_ROLE }}|' ./ecs/deployment-task.json sed -i 's||${{ vars.ECS_SERVICE_NAME }}|' ./ecs/deployment-task.json sed -i 's||${{ secrets.SSM_NAMESPACE }}|' ./ecs/deployment-task.json sed -i 's||${{ secrets.ECR_REPOSITORY_URI }}:latest-octane|' ./ecs/deployment-task.json diff --git a/docker/nginx/default.conf b/docker/nginx/default.conf index b976ae5..9b46cd1 100755 --- a/docker/nginx/default.conf +++ b/docker/nginx/default.conf @@ -29,8 +29,8 @@ server { location = /favicon.ico { access_log off; log_not_found off; } location = /robots.txt { access_log off; log_not_found off; } - access_log off; - error_log /var/log/nginx/gamewatch.log error; + access_log /dev/stdout; + error_log /dev/stderr; error_page 404 /index.php; diff --git a/ecs/deployment-task.json b/ecs/deployment-task.json index afc4aa6..b7dfc5a 100644 --- a/ecs/deployment-task.json +++ b/ecs/deployment-task.json @@ -1,6 +1,10 @@ { - "executionRoleArn": "", "family": "-task", + "executionRoleArn": "", + "taskRoleArn": "", + "requiresCompatibilities": ["EC2"], + "cpu": "256", + "memory": "512", "networkMode": "bridge", "containerDefinitions": [ { @@ -183,8 +187,5 @@ } } } - ], - "requiresCompatibilities": ["EC2"], - "cpu": "256", - "memory": "512" + ] } \ No newline at end of file