Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[20기_임가현] Docker를 이용한 배포 미션 제출합니다. #60

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

limgahyun
Copy link

No description provided.

@limgahyun limgahyun changed the title Feat: 환경 변수 설정 및 readme 작성 [20기_임가현] Docker를 이용한 배포 미션 제출합니다. Nov 23, 2024
Copy link

@nimikgnoej nimikgnoej left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!
제 코멘트가 도움이 될지는 모르겠지만 해보시고 알려주세요 저도 궁금해요

2. sudo docker pull mysql
3. mysql 컨테이너 생성 및 실행 : sudo docker run -e MYSQL_ROOT_PASSWORD=password -d -p 3306:3306 mysql
4. .env파일을 별도로 만들어둠 (vi .env)
5. instagram 컨테이너 생성 및 실행 : sudo docker run -e .env -d -p 80:8080 dingdong20/instagram

Choose a reason for hiding this comment

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

.env 파일을 docker 에게 넘겨줄때 -e 를 사용하셨는데, 제가 알기로는 -e 는 환경변수 값들을 하나씩 주입해줄때 쓰고 파일을 통째로 넘길때에는 --env-file 을 쓰는 것으로 알고 있어요.

이것 때문인지는 확실하지 않지만 한번 시도해보시면 좋을 것 같슴니다


ec2 인스턴스 중지를 하면 컴퓨터 전체를 끝낸다고 생각하면됨 (근데 중지해도 ip 할당은 받은 상태라서 돈은 나감)

서버 내릴때는 sudo docker rm -f instagram 으로 컨테이너를 제거!!

Choose a reason for hiding this comment

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

docker rm -f <name> 은 강제로 삭제 해버리는 명령어 입니다. 이렇게 실행중인 컨테이너를 냅다 삭제 해버리는 것도 틀린 방법은 아니지만

docker stop <name>
docker rm <name> 

하면 좀 더 안전?하게 삭제 가능해요!

@limbs713 limbs713 merged commit 4be8e07 into CEOS-Developers:limgahyun Nov 29, 2024
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.

3 participants