REGION_ID는 앱을 만들 때 선택한 리전을 기준으로 Google에서 할당하는 축약된 코드입니다. 일부 리전 ID는 일반적으로 사용되는 국가 및 주/도 코드와 비슷하게 표시될 수 있지만 코드는 국가 또는 주/도와 일치하지 않습니다. 2020년 2월 이후에 생성된 앱의 경우 REGION_ID.r이 App Engine URL에 포함됩니다. 이 날짜 이전에 만든 기존 앱의 경우 URL에서 리전 ID는 선택사항입니다.
gcloud 명령줄 도구를 제공하는 Google Cloud CLI를 설치합니다. gcloud가 배포할 Google Cloud 프로젝트를 사용하도록 구성되었는지 확인합니다.
핵심 사항
gcloud app deploy 및 gcloud app browse를 사용하여 서비스를 배포하고 봅니다.
서비스 배포
Maven POM 또는 Gradle 빌드 파일이 있는 my-java-service 폴더에서 다음 명령어를 터미널에 실행합니다.
gcloudappdeploy
그러면 소스 파일이 Cloud Storage에 업로드됩니다. Cloud Build가 앱을 빌드하여 App Engine에 배포합니다.
여러 서비스 배포
서비스별로 app.yaml 파일을 만들어 프로젝트에 여러 서비스를 추가할 수 있습니다. 각 app.yaml 파일에 service 속성을 포함하여 서비스 이름을 지정합니다.
여러 서비스를 사용한 앱 구조화에 대한 자세한 내용은 App Engine의 웹 서비스 구조화를 참조하세요.
[[["이해하기 쉬움","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-04(UTC)"],[[["\u003cp\u003eThe \u003ccode\u003eREGION_ID\u003c/code\u003e is a Google-assigned code based on the region selected during app creation, and it's included in App Engine URLs for apps created after February 2020.\u003c/p\u003e\n"],["\u003cp\u003eThe guide demonstrates how to use the \u003ccode\u003egcloud\u003c/code\u003e CLI to deploy a Java web service to App Engine, with the \u003ccode\u003egcloud app deploy\u003c/code\u003e command being the primary tool for this.\u003c/p\u003e\n"],["\u003cp\u003eMultiple services can be deployed within a single project by creating separate \u003ccode\u003eapp.yaml\u003c/code\u003e files for each service and specifying the \u003ccode\u003eservice\u003c/code\u003e attribute.\u003c/p\u003e\n"],["\u003cp\u003eAfter deploying a service, it can be accessed via a URL that follows the format \u003ccode\u003ehttps://PROJECT_ID.REGION_ID.r.appspot.com\u003c/code\u003e, and the \u003ccode\u003egcloud app browse\u003c/code\u003e command can launch the browser to this address.\u003c/p\u003e\n"],["\u003cp\u003eEach deployment of a service creates a new version, with traffic automatically routed to the latest one, and the first service deployed must be the default service.\u003c/p\u003e\n"]]],[],null,["# Deploy your web service\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\n### Region ID\n\nThe \u003cvar translate=\"no\"\u003eREGION_ID\u003c/var\u003e is an abbreviated code that Google assigns\nbased on the region you select when you create your app. The code does not\ncorrespond to a country or province, even though some region IDs may appear\nsimilar to commonly used country and province codes. For apps created after\nFebruary 2020, \u003cvar translate=\"no\"\u003eREGION_ID\u003c/var\u003e`.r` is included in\nApp Engine URLs. For existing apps created before this date, the\nregion ID is optional in the URL.\n\nLearn more\n[about region IDs](/appengine/docs/standard/python/how-requests-are-routed#region-id). \nOK\n\n\u003cbr /\u003e\n\n| **Note:** If you are deploying a new Java web service to Google Cloud, we recommend getting started with [Cloud Run](/run/docs/quickstarts/build-and-deploy/deploy-java-service).\n\nThis section of the guide shows how to use the gcloud CLI to deploy your\nJava web service on App Engine. To learn more about\nthe Java runtime environment, see\n[Java Runtime Environment](/appengine/docs/standard/java-gen2/runtime).\n\nBefore you begin\n----------------\n\n1. [Create a Google Cloud project with an App Engine app](/appengine/docs/standard/java-gen2/building-app/creating-project).\n2. [Write a Java web server ready to deploy on App Engine](/appengine/docs/standard/java-gen2/building-app/writing-web-service).\n3. [Install Google Cloud CLI](/sdk/docs/install), which provides the `gcloud` command-line tool. Ensure `gcloud` is configured to use the Google Cloud project you want to deploy to.\n\nKey points\n----------\n\n- Use `gcloud app deploy` and `gcloud app browse` to deploy and view your service.\n\nDeploy your service\n-------------------\n\nIn your `my-java-service` folder, where your Maven POM or\nGradle build file is located, run the following command in your terminal: \n\n gcloud app deploy\n\nYour source files are then uploaded to Cloud Storage. Cloud Build\nbuilds your app and deploys it to App Engine.\n| **Note:** Files listed in your [`.gcloudignore`](/sdk/gcloud/reference/topic/gcloudignore) file will not be uploaded.\n\n### Deploy multiple services\n\nYou can add multiple services in your project by creating an `app.yaml` file for each service. Include the\n`service` attribute in each `app.yaml` file to specify the name of the service.\nTo learn more about structuring your app using multiple services, see\n[Structuring Web Services in App Engine](/appengine/docs/standard/configuration-files#directory_structure).\n\nTo deploy multiple services, follow [these instructions](/appengine/docs/standard/testing-and-deploying-your-app#deploying_multiple_services)\n\nEach deployed service will have its own assigned URL.\n\nView your service\n-----------------\n\nTo quickly launch your browser and access your web service at\n\n`https://`\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e`.`\u003cvar translate=\"no\"\u003e\u003ca href=\"#appengine-urls\" style=\"border-bottom: 1px dotted #999\" class=\"devsite-dialog-button\" data-modal-dialog-id=\"regional_url\" track-type=\"progressiveHelp\" track-name=\"modalHelp\" track-metadata-goal=\"regionalURL\"\u003eREGION_ID\u003c/a\u003e\u003c/var\u003e`.r.appspot.com`, use the following\ncommand: \n\n gcloud app browse\n\nServices and versions\n---------------------\n\nYou've just created and deployed a service on App Engine.\nYou can specify the name of your service in the `app.yaml` file. If the\nname is omitted, it is treated as `default`. The first service you deploy\nmust be the default service.\n\nYou can update your service at any time by running the `gcloud app deploy`\ncommand again. Each time you deploy, a new version is created and traffic\nis automatically routed to the latest version.\n\nTo confirm that your service has been created and a version has been deployed:\n\n1. View your App Engine services in the Google Cloud console:\n\n [View services](https://console.cloud.google.com/appengine/services)\n\n You should see one service listed, named `default`. The default service is\n publicly accessible at the following URL:\n\n\n `https://`\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e`.`\u003cvar translate=\"no\"\u003e\u003ca href=\"#appengine-urls\" style=\"border-bottom: 1px dotted #999\" class=\"devsite-dialog-button\" data-modal-dialog-id=\"regional_url\" track-type=\"progressiveHelp\" track-name=\"modalHelp\" track-metadata-goal=\"regionalURL\"\u003eREGION_ID\u003c/a\u003e\u003c/var\u003e`.r.appspot.com`\n2. View your versions:\n\n [View versions](https://console.cloud.google.com/appengine/versions)\n\n You should see one timestamped version listed, corresponding to your\n deployment.\n\nTo learn how to send requests to specific services and versions, see\n[How Requests are Routed](/appengine/docs/standard/how-requests-are-routed).\n\nNext steps\n----------\n\nCongratulations! You built an application that can store and classify uploaded\nimages. Learn how to add other features to your application by exploring the\nfollowing pages:\n\n- See more Java code samples for the App Engine standard environment on the [Google Cloud GitHub repository.](https://github.com/GoogleCloudPlatform/java-docs-samples/). These samples can be used for both Java.\n- Learn more about writing application logs and interpreting system logs in [Reading and writing application logs](/appengine/docs/standard/writing-application-logs).\n- For a deeper dive into how App Engine works, see the [Java runtime environment](/appengine/docs/standard/java-gen2/runtime)."]]