Skip to content

[천수] sprint11#86

Merged
O-Seonsik merged 13 commits into
codeit-bootcamp-nodejs:천수from
Seracine:천수-sprint11
Oct 21, 2025

Hidden character warning

The head ref may contain hidden characters: "\ucc9c\uc218-sprint11"
Merged

[천수] sprint11#86
O-Seonsik merged 13 commits into
codeit-bootcamp-nodejs:천수from
Seracine:천수-sprint11

Conversation

@Seracine
Copy link
Copy Markdown
Collaborator

@Seracine Seracine commented Oct 16, 2025

미션 목표

  • Github Actions로 테스트, 배포 자동화
  • Docker 이미지 만들기

요구사항

Github Actions 활용

  • 브랜치에 pull request가 발생하면 테스트를 실행하는 액션을 구현해 주세요.
  • main 브랜치에 push가 발생하면 AWS 배포를 진행하는 액션을 구현해 주세요.
  • 개인 Github 리포지터리에서 Actions 동작을 확인해 보세요.

Docker 이미지 만들기

다음을 만족하는 Dockerfile과 docker-compose.yaml을 작성해 주세요.

  • Express 서버를 실행하는 Dockerfile을 작성해 주세요.
  • Express 서버가 파일 업로드를 처리하는 폴더는 Docker의 Volume을 활용하도록 구현해 주세요.
  • 데이터베이스는 Postgres 이미지를 사용해 연결하도록 구현해 주세요.
  • 실행된 Express 서버 컨테이너는 호스트 머신에서 3000번 포트로 접근 가능하도록 구현해 주세요.

멘토에게

  • CI/CD에서 사용하는 환경 변수는 github의 enviroment secret기능을 활용하여 원하는 환경에 맞게 변수를 구분하였습니다.
  • CI에서 PR시 테스트를 실행하는 액션에 대해 브랜치 조건이 없었기에 제 이름과 main 브랜치에 대해 수행되도록 작성하였습니다. Docker-compose.yaml에서 depend_on과 service_healthy를 추가하여 postgres가 정상적으로 동작이 확인되었을때 백엔드 서버가 실행되도록 구현하였습니다.
  • 학습을 위해 Docker-compose.yaml에서 env_file과 environment를 사용하는 방법을 구성해보았습니다. 보안을 위해서라면 env_file에 전부 넣는게 맞다는 생각이 드는데 이부분은 어떻게 생각하시는지 궁금합니다.
  • CD시 AWS환경에서 docker를 활용한 배포 방법이 궁금합니다. (ec2에서 docker를 설정하는 등)

@Seracine Seracine requested a review from O-Seonsik October 16, 2025 08:31
Comment thread .github/workflows/ci.yml
test:
runs-on: ubuntu-latest
env:
DATABASE_URL: postgresql://postgres:test_password@localhost:5432/test_db?schema=public
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

db host 도 환경변수로 처리하는 것이 안전합니다!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기 있는 모든 민감한 정보들은 환경변수로 처리하시는게 좋을 것 같습니다.
db host, jwt_secret db_password 등

@O-Seonsik
Copy link
Copy Markdown
Collaborator

도커를 통한 배포 방법을 오늘 멘토링 시간에 말씀드리겠습니다!

@O-Seonsik O-Seonsik merged commit 9364e37 into codeit-bootcamp-nodejs:천수 Oct 21, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants