변경사항을 저장한 후 Cloud Code가 애플리케이션을 자동으로 다시 배포하도록 하려면 감시 모드 - 다시 빌드 및 재배포에서 파일 저장형을 선택합니다. 새 Cloud Run 서비스에는 기본적으로 주문형이 선택되어 있습니다. 감시 모드에 대한 자세한 내용은 감시 모드를 참조하세요.
로컬에서 개발할 때 구성 수정을 선택하면 고급 버전 설정 섹션을 사용해 서비스 계정, 환경 변수, SQL 연결(Cloud Run(완전 관리형)을 사용하는 경우)과 같은 추가 설정을 지정할 수 있습니다.
환경 변수
다음 환경 변수는 실행 중인 컨테이너에 자동으로 추가됩니다.
이름
설명
예시
PORT
HTTP 서버가 리슨하는 포트입니다.
8080
K_SERVICE
실행되는 Cloud Run 서비스의 이름입니다.
hello-world
K_REVISION
실행되는 Cloud Run 버전의 이름입니다.
hello-world.1
K_CONFIGURATION
버전을 만든 Cloud Run 구성의 이름입니다.
hello-world
보안 비밀 저장
코드에 API 키, 비밀번호, 인증서와 같이 민감할 수 있는 데이터가 포함된 경우 이를 보안 비밀로 저장하는 것이 좋습니다. Cloud Code를 사용하면 이러한 보안 비밀을 Secret Manager에 안전하게 저장하고 필요할 때 프로그래매틱 방식으로 가져올 수 있습니다. Cloud Code를 사용하여 보안 비밀을 만들고 관리하는 방법에 대한 자세한 내용은 Secret Manager 가이드를 참조하세요.
서비스 실행
서비스를 실행하려면 다음 단계를 따르세요.
탐색 메뉴의 실행/디버그 구성 선택기에서 Cloud Run: 로컬로 실행 실행 대상을 선택합니다.
Cloud Run: 로컬에서 실행을 클릭합니다.
실행 중인 서비스의 로그를 출력 창으로 직접 스트리밍하여 볼 수 있습니다.
배포가 완료되면 이벤트 로그 패널에 표시된 URL을 따라 실행 중인 서비스를 볼 수 있습니다. 아래 예시에서 이 URL은 http://localhost:8080입니다.
지원 받기
IntelliJ IDE에서 의견을 제출하거나 문제를 신고하려면 도구 > Cloud Code > 도움말 / 정보 > 의견 제출 또는 문제 신고로 이동하여 GitHub에 문제를 신고합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-05(UTC)"],[[["\u003cp\u003eCloud Code enables local development of Cloud Run services in a simulated environment, with real-time updates reflecting code changes.\u003c/p\u003e\n"],["\u003cp\u003eBefore running a service, users must define a run configuration in the "Edit Configurations" section, specifying options like the builder type and watch mode preference.\u003c/p\u003e\n"],["\u003cp\u003eDuring local development, users can customize configurations by adding settings such as service accounts, environment variables, and SQL connections.\u003c/p\u003e\n"],["\u003cp\u003eCloud Code automatically adds environment variables like PORT, K_SERVICE, K_REVISION, and K_CONFIGURATION to running containers.\u003c/p\u003e\n"],["\u003cp\u003eSecrets, such as API keys and passwords, can be securely stored in Secret Manager and accessed programmatically using Cloud Code.\u003c/p\u003e\n"]]],[],null,["# Develop a service locally in Cloud Code for IntelliJ\n\nWith Cloud Code, you can develop your Cloud Run services\nlocally in a Cloud Run-like environment. Cloud Code watches\nfor changes in your source and quickly updates the running service to\nreflect these changes.\n\nDefining your run configuration\n-------------------------------\n\nBefore you run your service, you must create your run configuration:\n\n1. Navigate to Run/Debug configurations selector in the Navigation bar and click **Edit Configurations**.\n2. Under Cloud Code: Cloud Run, choose **Cloud Run: Run Locally**.\n3. If you want Cloud Code to redeploy your application automatically after your changes are saved, under **Watch mode - rebuild and\n redeploy** , select **On file save** . New Cloud Run services have **On demand** selected by default. For more information about watch modes, see [Watch modes](/code/docs/intellij/watch-modes).\n4. Specify your builder option and its relevant settings.\n\n Cloud Code supports Docker, Jib, and Buildpacks\n [artifact types](https://skaffold.dev/docs/builders/).\n5. Click **OK**.\n\n### Optional: Customizing your configuration\n\nWhen developing locally, you can specify additional settings like a service\naccount, environment variables, and SQL connections (when using\nCloud Run (fully managed)), using the Advanced revision settings section when\nyou choose **Edit Configurations**.\n\n#### Environment variables\n\nThe following environment variables are automatically added to the\nrunning containers:\n\nStoring secrets\n---------------\n\nIf your code includes potentially sensitive data like API keys, passwords, and\ncertificates, it is recommended you store them as secrets. With\nCloud Code, you can securely store these secrets in Secret Manager\nand programmatically fetch them when you need them. For a detailed look at\nhow you can create and manage secrets with Cloud Code, refer to\nthe [Secret Manager guide](/code/docs/intellij/secret-manager).\n\nRunning your service\n--------------------\n\nTo run your service, follow these steps:\n\n1. Choose the **Cloud Run: Run Locally** run target from the Run/Debug configurations selector in the Navigation bar.\n2. Click **Cloud Run: Run Locally**.\n3. View the logs from your running service, streamed directly to the **output window**.\n4. Once deployment is complete, you can view your running service by following the\n URL displayed in your Event Log panel. In the example below, this URL is\n http://localhost:8080.\n\nGet support\n-----------\n\nTo submit feedback or report an issue in your IntelliJ IDE, go to **Tools** \\\u003e **Cloud Code** \\\u003e **Help / About** \\\u003e **Submit\nfeedback or report an issue** to report an issue on [GitHub](https://github.com/GoogleCloudPlatform/cloud-code-intellij/issues)."]]