diff --git a/deployment.md b/deployment.md index b108347..43c5a1a 100644 --- a/deployment.md +++ b/deployment.md @@ -50,13 +50,21 @@ htpasswd /etc/nginx/.htpasswd anotheruser ## 4. VaultKeeper 실행 -`config.json` 파일 생성 및 `.htpasswd` 파일 준비가 완료되면, 빌드된 VaultKeeper 바이너리를 실행합니다. +`config.json` 파일 생성 및 `.htpasswd` 파일 준비가 완료되면, `run.sh` 스크립트를 사용하여 VaultKeeper를 쉽게 빌드하고 실행할 수 있습니다. + +먼저, `run.sh` 파일에 실행 권한을 부여합니다: ```bash -./vaultkeeper +chmod +x run.sh ``` -VaultKeeper는 `config.json`에 설정된 포트에서 수신 대기합니다 (기본값: 8000번 포트). +그 다음, 다음 명령어를 실행하여 VaultKeeper를 시작합니다: + +```bash +./run.sh +``` + +`run.sh` 스크립트는 Go 바이너리를 빌드하고 실행합니다. VaultKeeper는 `config.json`에 설정된 포트에서 수신 대기합니다 (기본값: 8000번 포트). ## 5. Nginx 설정 예시 diff --git a/run.sh b/run.sh new file mode 100644 index 0000000..4f495f2 --- /dev/null +++ b/run.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# 백엔드 빌드 +echo "VaultKeeper 백엔드를 빌드합니다..." +go build -o vaultkeeper -ldflags "-s -w" main.go + +if [ $? -ne 0 ]; then + echo "빌드 실패." + exit 1 +fi + +echo "빌드 성공. VaultKeeper를 실행합니다..." +echo "-----------------------------------" + +# VaultKeeper 실행 +./vaultkeeper