forked from baron/baron-sso
Remove conditional skipping of 'npx playwright install --with-deps' to ensure OS-level dependencies are installed even when browser binaries are cached.
Docker 이미지 빌드 및 배포 가이드
이 문서는 Baron SSO 애플리케이션의 Backend와 Frontend Docker 이미지를 빌드하고, Private Registry에 푸시한 뒤, 서버에 배포하는 과정을 안내합니다.
1. Docker 이미지 빌드 및 태그
Backend와 Frontend 애플리케이션을 각각의 Dockerfile을 사용하여 빌드하고, 레지스트리에 푸시할 수 있도록 이미지에 태그를 지정합니다.
주의: 아래 모든 명령어는 프로젝트 최상위 루트 디렉토리에서 실행해야 합니다.
# Backend 이미지 빌드
# v1.2601.1-RC1 부분은 실제 배포 버전에 맞게 수정하세요.
docker build -t reg.hmac.kr/baron_sso/backend:v1.2601.1-RC1 -f backend/Dockerfile .
# Frontend 이미지 빌드
docker build -t reg.hmac.kr/baron_sso/userfront:v1.2601.1-RC1 -f userfront/Dockerfile .
2. Private 레지스트리 로그인
빌드한 이미지를 푸시하기 위해 Private Docker Registry(reg.hmac.kr)에 로그인합니다.
최초 한 번만 인증하면 이후에는 로그인 과정이 필요 없을 수 있습니다.
docker login reg.hmac.kr
3. Docker 이미지 푸시
로컬에 빌드된 두 이미지를 Private Registry로 업로드합니다. 이 과정을 통해 배포 서버에서 해당 이미지를 내려받을 수 있게 됩니다.
# Backend 이미지 푸시
docker push reg.hmac.kr/baron_sso/backend:v1.2601.1-RC1
# Frontend 이미지 푸시
docker push reg.hmac.kr/baron_sso/userfront:v1.2601.1-RC1
4. 서버 배포 및 서비스 실행
배포 서버에서 docker-compose.deploy.yaml 파일을 사용하여 이미지를 내려받고 컨테이너를 실행합니다.
로컬 테스트 시에는 compose.infra.yaml을 함께 사용하여 전체 인프라를 구동할 수 있습니다.
# 로컬 환경에서 전체 서비스(인프라 포함) 실행
# -d 옵션은 컨테이너를 백그라운드에서 실행합니다.
docker compose -f docker/docker-compose.deploy.yaml -f docker/compose.infra.yaml up -d
서비스 중지
실행 중인 모든 서비스를 중지하고 컨테이너를 삭제하려면 아래 명령어를 사용합니다.
docker compose -f docker/docker-compose.deploy.yaml -f docker/compose.infra.yaml down