feat: deploy#11
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughConfiguration 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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.
| # 헬스체크 | ||
| 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 |
There was a problem hiding this comment.
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.
| # 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 |
There was a problem hiding this comment.
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).
| 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 |
There was a problem hiding this comment.
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.
| 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 |
| EOF | ||
| RABBITMQ_HOST=${{ secrets.RABBITMQ_HOST }} | ||
| RABBITMQ_PORT=${{ secrets.RABBITMQ_PORT }} | ||
| RABBITMQ_USER=${{ secrets.RABBITMQ_USER }} |
There was a problem hiding this comment.
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).
| RABBITMQ_USER=${{ secrets.RABBITMQ_USER }} | |
| RABBITMQ_USERNAME=${{ secrets.RABBITMQ_USER }} |
| password: jagalchi123 | ||
| host: ${RABBITMQ_HOST:rabbitmq.jagalchi.local} | ||
| port: ${RABBITMQ_PORT:5672} | ||
| username: ${RABBITMQ_USER:jagalchi} |
There was a problem hiding this comment.
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.
| username: ${RABBITMQ_USER:jagalchi} | |
| username: ${RABBITMQ_USERNAME:jagalchi} |
🎫 관련 이슈
close #
📄 개요
🔨 작업 내용
🏁 확인 사항
🙋🏻 덧붙일 말
Summary by CodeRabbit
Release Notes