Skip to content

Commit 746baa9

Browse files
authored
[FIX] docker-compose 없어서 오류 나는 문제 해결
[FIX] docker-compose 없어서 오류 나는 문제 해결
2 parents 70efb2f + ef38048 commit 746baa9

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

gdgoc/appspec.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ hooks:
88
AfterInstall:
99
- location: deploy.sh
1010
timeout: 300
11-
runas: ubuntu
11+
runas: root

gdgoc/deploy.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
#!/bin/bash
22
cd /home/ubuntu/gdgoc-be-app
33

4+
# Docker & Docker Compose가 설치되어 있는지 확인
5+
if ! [ -x "$(command -v docker)" ]; then
6+
echo "Docker가 설치되어 있지 않습니다. 설치 중..."
7+
sudo apt update
8+
sudo apt install -y docker.io
9+
sudo systemctl start docker
10+
sudo systemctl enable docker
11+
echo "Docker 설치 완료"
12+
fi
13+
14+
if ! [ -x "$(command -v docker-compose)" ]; then
15+
echo "Docker Compose가 설치되어 있지 않습니다. 설치 중..."
16+
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
17+
sudo chmod +x /usr/local/bin/docker-compose
18+
echo "Docker Compose 설치 완료"
19+
fi
20+
421
# 기존 컨테이너 중지 및 삭제
522
docker-compose down
623

0 commit comments

Comments
 (0)