-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
19 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,30 @@ | ||
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: | ||
image: grafana/promtail:2.5.0 | ||
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 |