목록2024/08/11 (2)
Hanbit the Developer
Docker와 Docker Compose 도입이전 글의 과정으로 CI를 도입하니 Docker와 CD를 활용해 편하게 배포를 하고 싶어졌습니다. 우선 도커부터 도입하려고 합니다.Docker는 애플리케이션을 컨테이너화하여 어디서나 동일하게 동작할 수 있게 해줍니다. 저는 GitHub Action 환경, ec2 환경을 통해 배포를 해야하기 때문에 도커를 도입하기에 적절해 보였습니다. 또한 저의 경우 프론트엔드와 백엔드를 모두 관리해야 했기 때문에, Docker Compose를 도입하게 되었습니다.0. Docker 기본 개념도커 기본 개념을 간략히 설명하겠습니다.Dockerfile: 애플리케이션을 어떻게 실행할지를 정의합니다.Image: 실행 가능한 애플리케이션 패키지입니다.Container: 실제로 동작 중인..
배경처음에는 간단하게 EC2에 코드를 푸시하고, 수동으로 빌드하고, 배포를 하려고 했습니다. 수동 배포로 날리는 시간보다 관련 공부를 하고 적용하는 시간이 훨씬 길 것이라고 생각했기 때문입니다. 하지만 다시 생각해보니 수동 배포는 시간을 버리는 것인데 비해, CI/CD 도입 과정은 저에게 도움이 되는 유용한 시간이라고 생각하게 되어 이 여정을 시작하게 되었습니다.GitHub Actions CI 도입먼저 github에 PR을 올리면 테스트 코드를 자동으로 돌릴 수 있도록 CI(Continuous Integration)를 도입하기로 했습니다. GitHub Actions에 CI를 도입하기 위해선, .github/workflows/ci.yml 파일을 추가하고 remote에 푸시해야 합니다. 다음은 ci.yml의..