접근
웹 인터페이스: https://<SERVER_IP>
API 엔드포인트: https://<SERVER_IP>:5004
기본 관리자 계정 정보:
- 이메일:
[email protected] - 암호:
1234
첫 로그인 후 즉시 관리자 자격 증명을 변경하세요.
자체 서명 인증서 안내
이 설치에는 자체 서명 TLS 인증서가 사용됩니다.
브라우저에서 SSL 경고가 표시될 수 있습니다.
API 호출 시 사용: curl, 인증서 유효성 검사를 무시해야 합니다:
curl -k https://<SERVER_IP>:5004
더 -k flag는 curl에게 TLS 인증서 검증을 건너뛰도록 지시합니다.
API 토큰을 얻는 예시:
curl -k https://<SERVER_IP>:5004/api/v1/auth/login
-H "Content-Type: application/json"
-d '{"email":"[email protected]","password":"1234"}'
이 요청은 토큰이 포함된 JSON 응답을 반환합니다.
API 토큰을 얻는 예시:
curl -k -i https://<SERVER_IP>:5004/api/v1/<VALID_ENDPOINT>
-H "Authorization: Bearer <TOKEN>"
프로덕션 환경에서는 자체 서명 인증서를 신뢰할 수 있는 SSL 인증서(예: Let's Encrypt)로 교체하세요.
주요 파일 및 디렉터리
- 설치 디렉토리:
/root/peppermint - 환경 변수 (DB 자격 증명, 시크릿, BASE_URL):
/root/peppermint/.env - Docker Compose 설정:
/root/peppermint/docker-compose.yml - PostgreSQL 영구 데이터 (Docker 볼륨):
/var/lib/docker/volumes/pgdata/_data - Nginx 리버스 프록시 설정:
/etc/nginx/conf.d/peppermint-client.conf&/etc/nginx/conf.d/peppermint-api.conf - TLS 인증서 (자체 서명 또는 Let's Encrypt):
/etc/nginx/ssl/
도메인으로 SSL 활성화하기
1. 도메인을 서버 IP로 연결합니다.
2. 편집 /root/peppermint/.env 도메인 이름을 설정하는 파일: BASE_URL=https://your.domain.com
3. 서비스 재생성:
cd /root/peppermint/
docker compose up -d
4. Nginx 설정 파일을 열고 다음을 교체합니다 server_name <IP>; 을 실제 도메인으로 교체합니다 (<your-domain>) HTTP (포트 80) 및 HTTPS (포트 443) 블록 모두에 적용합니다:
vim /etc/nginx/conf.d/peppermint-client.conf
vim /etc/nginx/conf.d/peppermint-api.conf
5. Certbot 설치:
apt install -y certbot python3-certbot-nginx
6. 다음 명령어를 실행하여 유효한 Let's Encrypt 인증서를 발급받으세요:
certbot certonly --nginx --non-interactive --agree-tos --email [email protected] -d yourdomain.com
7. Nginx 설정(TLS 섹션)에서 SSL 경로를 교체합니다:
vim /etc/nginx/conf.d/peppermint-client.conf
vim /etc/nginx/conf.d/peppermint-api.conf
# Before:
# ssl_certificate /etc/nginx/ssl/fullchain.pem;
# ssl_certificate_key /etc/nginx/ssl/privkey.pem;
# After:
# ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
8. 변경 사항을 적용하려면 Nginx를 재시작합니다:
systemctl restart nginx
9. 브라우저를 열고 다음 주소로 접속하세요: https://yourdomain.com