From 7e70781b9c9082e1591491d99a6112c3b0217a34 Mon Sep 17 00:00:00 2001 From: 5uhwann <5uhwann27@gmail.com> Date: Tue, 24 Sep 2024 13:31:01 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20promtail=20ebextension=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .ebextensions/02-install-promtail.config | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.ebextensions/02-install-promtail.config b/.ebextensions/02-install-promtail.config index bdcb7647..981669c8 100644 --- a/.ebextensions/02-install-promtail.config +++ b/.ebextensions/02-install-promtail.config @@ -1,9 +1,21 @@ container_commands: - 01_install_docker_compose: - command: "curl -L https://github.com/docker/compose/releases/download/v2.5.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose" + 01_install_docker: + command: | + # Docker 설치 + amazon-linux-extras install -y docker + service docker start # Docker 서비스 시작 + + 02_install_docker_compose: + command: | + # Docker Compose 설치 + curl -L https://github.com/docker/compose/releases/download/v2.5.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose + chmod +x /usr/local/bin/docker-compose + docker-compose --version # 설치된 Docker Compose 버전 확인 - 02_setup_promtail: + 03_setup_promtail: command: | + set -e # 오류 발생 시 스크립트 종료 + # Promtail Docker Compose 설정 파일 생성 echo "version: '3' services: promtail: @@ -11,5 +23,8 @@ container_commands: volumes: - /var/log:/var/log - /tmp/positions.yaml:/tmp/positions.yaml - command: -config.file=/var/app/current/promtail-config.yml" > /var/app/current/promtail-docker-compose.yml + - /etc/app/current:/etc/app/current # 로그 파일 위치를 이곳으로 변경 + command: -config.file=/etc/app/current/promtail-config.yml" > /var/app/current/promtail-docker-compose.yml + + # Docker Compose로 Promtail 실행 docker-compose -f /var/app/current/promtail-docker-compose.yml up -d