Skip to content

feat: deploy#11

Merged
HyunwooKiim merged 1 commit into
mainfrom
feat/deploy
Apr 2, 2026
Merged

feat: deploy#11
HyunwooKiim merged 1 commit into
mainfrom
feat/deploy

Conversation

@HyunwooKiim

@HyunwooKiim HyunwooKiim commented Apr 2, 2026

Copy link
Copy Markdown
Member

🎫 관련 이슈

close #


📄 개요


🔨 작업 내용


🏁 확인 사항

  • 테스트를 완료했나요?
  • API 문서를 작성했나요?
  • 코드 컨벤션을 준수했나요?
  • 불필요한 로그, 주석, import 등을 삭제했나요?

🙋🏻 덧붙일 말

Summary by CodeRabbit

Release Notes

  • Chores
    • Enhanced deployment configuration to support environment-variable-driven service settings, enabling flexible configuration across different deployment environments.
    • Improved Docker container health checks and artifact management for more reliable and consistent deployments.

Copilot AI review requested due to automatic review settings April 2, 2026 07:59
@HyunwooKiim HyunwooKiim merged commit c9d3e92 into main Apr 2, 2026
3 of 4 checks passed
@coderabbitai

coderabbitai Bot commented Apr 2, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8d8b0c75-0177-41b4-b92d-a323d6b9079e

📥 Commits

Reviewing files that changed from the base of the PR and between 5cba54c and 58c35db.

📒 Files selected for processing (4)
  • .github/workflows/deploy.yml
  • Dockerfile
  • docker-compose.yml
  • src/main/resources/application.yml

📝 Walkthrough

Walkthrough

Configuration updates across deployment workflow and application settings to support environment-variable-driven service connectivity. Changes enable flexible hostname/port resolution for MySQL, RabbitMQ, and Redis via environment variables, plus deployment artifact handling for Docker files and service URLs.

Changes

Cohort / File(s) Summary
Deployment Workflow
.github/workflows/deploy.yml
Modified artifact preparation to copy only JARs from build/libs/, include Docker files (Dockerfile, compose.yml) in artifacts, and extend .env generation to include service URL variables (USER_SERVICE_URL, GATEWAY_SERVICE_URL, NODE_SERVICE_URL, NODE_WS_URL, ROADMAP_SERVICE_URL).
Docker Configuration
Dockerfile, docker-compose.yml
Updated healthcheck endpoint from localhost to gateway.jagalchi.local in Dockerfile; made MySQL hostname configurable via ${MYSQL_HOST:-mysql} environment variable in compose file with corresponding healthcheck adjustment.
Application Settings
src/main/resources/application.yml
Converted hardcoded database and message broker connections to environment-variable-driven configuration: MySQL uses ${MYSQL_HOST:localhost}, RabbitMQ uses ${RABBITMQ_HOST}, ${RABBITMQ_PORT}, ${RABBITMQ_USER}, ${RABBITMQ_PASSWORD}, and Redis uses ${REDIS_HOST:localhost} and ${REDIS_PORT:6379}.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • feat: deploy #10: Modifies the same GitHub Actions deployment workflow (.github/workflows/deploy.yml) with related artifact preparation and remote deployment step changes.

Poem

🐰 With whiskers twitching, I hop with glee,
Environment variables set configs free!
No hardcoded paths shall bind us tight,
Docker healthchecks probe the light.
Flexible deployments—what a delight! 🚀

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/deploy

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates deployment-related configuration to make infrastructure endpoints configurable via environment variables and adjusts the CI deploy workflow artifacts.

Changes:

  • Parameterize MySQL/RabbitMQ/Redis host/port values via env vars in Spring config and docker-compose.
  • Update Docker healthcheck target.
  • Update GitHub Actions deploy workflow to package additional deployment artifacts and generate a .env.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
src/main/resources/application.yml Uses env-based hosts/ports for datasource and messaging/cache dependencies.
Dockerfile Changes container HEALTHCHECK target URL.
docker-compose.yml Makes MySQL host configurable in datasource URL and MySQL healthcheck.
.github/workflows/deploy.yml Adjusts artifacts packaging and writes a .env for deployment.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Dockerfile
Comment on lines 43 to +45
# 헬스체크
HEALTHCHECK --interval=30s --timeout=3s --start-period=40s --retries=3 \
CMD curl -f http://localhost:8080/actuator/health || exit 1
CMD curl -f http://gateway.jagalchi.local:8080/actuator/health || exit 1

Copilot AI Apr 2, 2026

Copy link

Choose a reason for hiding this comment

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

The container healthcheck runs inside the node container; curling http://gateway.jagalchi.local:8080/actuator/health will typically fail due to DNS/networking and it checks an external service rather than this container. Point the healthcheck at the local app (e.g., localhost on the actual server.port for the active profile) or make the host/port configurable via env if it must be external.

Copilot uses AI. Check for mistakes.
Comment on lines +28 to +30
# include module-local Dockerfile and docker-compose (assume present in module repo)
cp Dockerfile artifacts/Dockerfile 2>/dev/null || true
cp compose.yml artifacts/docker-compose.yml 2>/dev/null || true

Copilot AI Apr 2, 2026

Copy link

Choose a reason for hiding this comment

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

Prepare artifacts copies compose.yml to artifacts/docker-compose.yml, but this repository only has docker-compose.yml (no compose.yml). This will cause the remote deploy step to fail with docker-compose.yml not found. Copy the correct file name (or rename the compose file consistently).

Copilot uses AI. Check for mistakes.
cp build/libs/*.jar artifacts/ 2>/dev/null || true
# include module-local Dockerfile and docker-compose (assume present in module repo)
cp Dockerfile artifacts/Dockerfile 2>/dev/null || true
cp compose.yml artifacts/docker-compose.yml 2>/dev/null || true

Copilot AI Apr 2, 2026

Copy link

Choose a reason for hiding this comment

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

The deployment uploads only the built JAR plus Dockerfile/compose, but docker-compose.yml builds the image from context: . and the Dockerfile’s build stage COPYs gradlew, gradle/, build.gradle, settings.gradle, and src/. Those files are not included in artifacts/, so docker compose up -d --build on the server will fail. Either (1) deploy the full build context, (2) switch to a runtime-only Dockerfile that just copies the prebuilt JAR, or (3) build/push the image in CI and run without --build on the server.

Suggested change
cp compose.yml artifacts/docker-compose.yml 2>/dev/null || true
cp compose.yml artifacts/docker-compose.yml 2>/dev/null || true
# include Docker build context files required by the Dockerfile build stage
cp gradlew artifacts/ 2>/dev/null || true
cp -r gradle artifacts/gradle 2>/dev/null || true
cp build.gradle artifacts/build.gradle 2>/dev/null || true
cp settings.gradle artifacts/settings.gradle 2>/dev/null || true
cp -r src artifacts/src 2>/dev/null || true

Copilot uses AI. Check for mistakes.
EOF
RABBITMQ_HOST=${{ secrets.RABBITMQ_HOST }}
RABBITMQ_PORT=${{ secrets.RABBITMQ_PORT }}
RABBITMQ_USER=${{ secrets.RABBITMQ_USER }}

Copilot AI Apr 2, 2026

Copy link

Choose a reason for hiding this comment

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

Environment variable naming is inconsistent: application-docker.yml expects RABBITMQ_USERNAME, but the generated .env uses RABBITMQ_USER. With the docker profile, this will leave spring.rabbitmq.username unresolved (or default unexpectedly) and can prevent startup. Align the variable names across application-*.yml, docker-compose env, and this workflow (e.g., use RABBITMQ_USERNAME everywhere or update the docker profile to RABBITMQ_USER).

Suggested change
RABBITMQ_USER=${{ secrets.RABBITMQ_USER }}
RABBITMQ_USERNAME=${{ secrets.RABBITMQ_USER }}

Copilot uses AI. Check for mistakes.
password: jagalchi123
host: ${RABBITMQ_HOST:rabbitmq.jagalchi.local}
port: ${RABBITMQ_PORT:5672}
username: ${RABBITMQ_USER:jagalchi}

Copilot AI Apr 2, 2026

Copy link

Choose a reason for hiding this comment

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

The RabbitMQ env var names here (RABBITMQ_USER / RABBITMQ_PASSWORD) don’t match the docker profile (application-docker.yml uses RABBITMQ_USERNAME). This inconsistency will make it easy to misconfigure deployments (especially when switching profiles). Consider standardizing on one set of variable names across all application-*.yml files and deployment manifests.

Suggested change
username: ${RABBITMQ_USER:jagalchi}
username: ${RABBITMQ_USERNAME:jagalchi}

Copilot uses AI. Check for mistakes.
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