-
Notifications
You must be signed in to change notification settings - Fork 0
DB 배포 설정, 로컬 개발, 테스트용 디비 도커컴포즈 파일 추가 #10
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
5444bd7
chore: db설정용 docker compose 파일 추가
pilyang 411ecd9
chore: env example 추가
pilyang 382331b
docs: 디비 실행 커맨드 문서 추가
pilyang b9d1bb3
chore: dev, test 환경 docker-compose 파일 분리
pilyang 002c80b
docs: local에서 container로 실행환경 관련 내용 주석 추가
pilyang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,11 @@ | ||
| PORT=1234 | ||
| ENV=local | ||
| PORT=8080 | ||
|
|
||
| # local machine에서 local machine으로 접근할 때는 localhost를 사용 | ||
| POSTGRES_HOST=localhost | ||
| # # local machine에서 docker container로 접근할 때는 host.docker.internal을 사용 | ||
| # POSTGRES_HOST=host.docker.internal | ||
| POSTGRES_USER=example-user | ||
| POSTGRES_PASSWORD=password | ||
| POSTGRES_DB=tbh-db | ||
| POSTGRES_PORT=5432 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| .DS_Store | ||
|
|
||
| .idea | ||
| .env | ||
| *.env |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| ## DB 실행 | ||
|
|
||
| ### 로컬 DB 실행 | ||
| ```bash | ||
| ./dev-db.sh | ||
| ``` | ||
|
|
||
| ### 테스트용 DB 실행 | ||
| ```bash | ||
| ./test-db.sh | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| POSTGRES_USER=example-user | ||
| POSTGRES_PASSWORD=password | ||
| POSTGRES_DB=tbh-db | ||
| POSTGRES_PORT=5432 | ||
| POSTGRES_CONTAINER_NAME=local-tbh-postgres |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| POSTGRES_USER=example-user | ||
| POSTGRES_PASSWORD=password | ||
| POSTGRES_DB=tbh-db | ||
| POSTGRES_PORT=5432 | ||
| POSTGRES_CONTAINER_NAME=local-tbh-postgres |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| POSTGRES_USER=example-user | ||
| POSTGRES_PASSWORD=password | ||
| POSTGRES_DB=tbh-db | ||
| POSTGRES_PORT=5433 | ||
| POSTGRES_CONTAINER_NAME=test-tbh-postgres |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| name: dev-tbh-postgresql | ||
| services: | ||
| postgresql: | ||
| volumes: | ||
| - dev_postgres_data:/var/lib/postgresql/data | ||
| - dev_postgres_config:/etc/postgresql/postgresql.conf | ||
|
|
||
| volumes: | ||
| dev_postgres_data: | ||
| name: dev_postgres_data | ||
| dev_postgres_config: | ||
| name: dev_postgres_config |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| name: test-tbh-postgresql | ||
| services: | ||
| postgresql: | ||
| volumes: | ||
| - test_postgres_data:/var/lib/postgresql/data | ||
| - test_postgres_config:/etc/postgresql/postgresql.conf | ||
|
|
||
| volumes: | ||
| test_postgres_data: | ||
| name: test_postgres_data | ||
| test_postgres_config: | ||
| name: test_postgres_config |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| name: tbh-postgresql | ||
| services: | ||
| postgresql: | ||
| image: postgres:16 | ||
| container_name: ${POSTGRES_CONTAINER_NAME} | ||
| restart: unless-stopped | ||
| environment: | ||
| - POSTGRES_USER=${POSTGRES_USER} | ||
| - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} | ||
| - POSTGRES_DB=${POSTGRES_DB} | ||
| volumes: | ||
| - postgres_data:/var/lib/postgresql/data | ||
| - postgres_config:/etc/postgresql/postgresql.conf | ||
| ports: | ||
| - ${POSTGRES_PORT}:5432 | ||
| deploy: | ||
| resources: | ||
| limits: | ||
| cpus: "1" | ||
| memory: 512M | ||
| reservations: | ||
| memory: 256M | ||
|
|
||
| volumes: | ||
| postgres_data: | ||
| name: postgres_data | ||
| postgres_config: | ||
| name: postgres_config | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| docker compose -f ./deploy/postgresql/docker-compose.yml -f ./deploy/postgresql/docker-compose.dev.yml --env-file ./deploy/postgresql/.env.dev up -d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| docker compose -f ./deploy/postgresql/docker-compose.yml -f ./deploy/postgresql/docker-compose.test.yml --env-file ./deploy/postgresql/.env.test up -d |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 리소스도 정해둘 수 있네요 처음알았습니다!