docker-compose에서 .env 환경 변수 설정 에러 #83
Unanswered
kwongiyeon
asked this question in
개발
Replies: 1 comment
-
답변
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
도커 컴포즈 파일을 하나 만들어서 블루,그린으로 컨테이너 2개 실행 시키는 deploy.sh를 작성했습니다. 그리고 deploy.sh에서 만들어지는 컨테이너를 하나의 EC2에서 실행 시켜 blue-green으로 구현하려고 합니다.
.ENV를 도커 컴포즈에서 불러오도록 환경 변수를 설정해서 터미널에서 EXPORT 해놓고, EC2에 도커 컴포즈 yml 파일도 생성하기도 했습니다.
.env 값은 액션 시크릿에 기입되어 있는 상태입니다.
그런데 깃헙 액션을 실행 시켰을 때 .env가 불러와지지 않아서 컨테이너를 실행하지 못하고 있습니다. EC2로 파일 생성 및 복사할 때 deploy.sh와 docker-compose.yml 경로를 전부 /home/ubuntu로 지정했음에도 불구하고 .env를 인식하지 못했는지 err: time="2024-09-09T12:46:35Z" level=warning msg="The "DB_PASSWORD" variable is not set. Defaulting to a blank string."와 같은 에러만 발생합니다.
도커 컴포즈로 블루-그린 배포에 관하여 다른 팀원들한테 도움 요청해보고 인터넷을 참고해봤으나 아직까지 근본적인 원인도 해답도 찾지 못했습니다. 이 방법으로 안 되면 다른 방법을 고려할 생각입니다
Beta Was this translation helpful? Give feedback.
All reactions